[][src]Struct adblock::BlockerResult

pub struct BlockerResult {
    pub matched: bool,
    pub explicit_cancel: bool,
    pub important: bool,
    pub redirect: Option<String>,
    pub exception: Option<String>,
    pub filter: Option<String>,
    pub error: Option<String>,
}

The result of an ad-blocking check.

Fields

matched: boolexplicit_cancel: bool

Normally, Brave Browser returns 200 OK with an empty body when matched is True, except if explicit_cancel is also True, in which case the request is cancelled.

important: bool

Important is used to signal that a rule with the important option matched. An important match means that exceptions should not apply and no further checking is neccesary--the request should be blocked (empty body or cancelled).

Brave Browser keeps seperate instances of Blocker for default lists and regional ones, so important here is used to correct behaviour between them: checking should stop instead of moving to the next instance iff an important rule matched.

redirect: Option<String>

Iff the blocker matches a rule which has the redirect option, as per uBlock Origin's redirect syntax, the redirect is not None. The redirect field contains the body of the redirect to be injected.

exception: Option<String>

Exception is not None when the blocker matched on an exception rule. Effectively this means that there was a match, but the request should not be blocked. It is a non-empty string if the blocker was initialized from a list of rules with debugging enabled, otherwise the original string representation is discarded to reduce memory use.

filter: Option<String>

Filter--similarly to exception--includes the string representation of the rule when there is a match and debugging is enabled. Otherwise, on a match, it is not None.

error: Option<String>

The error field is only used to signal that there was an error in parsing the provided URLs when using the simpler check_network_urls method.

Trait Implementations

impl<'a> ExtractExt<'a> for &'a BlockerResult[src]

impl<'a> ExtractExt<'a> for &'a mut BlockerResult[src]

impl HasMethodsInventory for BlockerResult[src]

type Methods = Pyo3MethodsInventoryForBlockerResult

impl HasProtoRegistry for BlockerResult[src]

impl Into<BlockerResult> for RustBlockerResult[src]

impl IntoPy<PyObject> for BlockerResult[src]

impl PyClass for BlockerResult[src]

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it's PyDict. Read more

impl PyClassAlloc for BlockerResult[src]

impl PyClassSend for BlockerResult[src]

type ThreadChecker = ThreadCheckerStub<BlockerResult>

impl<'p> PyObjectProtocol<'p> for BlockerResult[src]

impl<'p> PyObjectReprProtocol<'p> for BlockerResult[src]

impl PyTypeInfo for BlockerResult[src]

type Type = BlockerResult

Type of objects to store in PyObject struct

type BaseType = PyAny

Base class

type Layout = PyCell<Self>

Layout

type BaseLayout = PyCellBase<PyAny>

Layout of Basetype.

type Initializer = PyClassInitializer<Self>

Initializer for layout

type AsRefTarget = PyCell<Self>

Utility type to make AsPyRef work

Auto Trait Implementations

impl RefUnwindSafe for BlockerResult

impl Send for BlockerResult

impl Sync for BlockerResult

impl Unpin for BlockerResult

impl UnwindSafe for BlockerResult

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromPy<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoPy<U> for T where
    U: FromPy<T>, 
[src]

impl<T> PyClassAlloc for T where
    T: PyTypeInfo + PyClassWithFreeList
[src]

impl<T> PyMethods for T where
    T: HasMethodsInventory, 
[src]

impl<T> PyProtoMethods for T where
    T: HasProtoRegistry, 
[src]

impl<T> PyTypeObject for T where
    T: PyTypeInfo
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.