[][src]Struct adblock::blocker::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>,
}

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 Some. The redirect field contains the body of the redirect to be injected.

exception: Option<String>

Exception is Some 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 Some.

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 crate::engine::Engine::check_network_urls method.

Trait Implementations

impl Debug for BlockerResult[src]

impl Default for BlockerResult[src]

impl Serialize for BlockerResult[src]

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, U> Into<U> for T where
    U: From<T>, 
[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.