[][src]Struct adblock::blocker::Blocker

pub struct Blocker { /* fields omitted */ }

Stores network filters for efficient querying.

Implementations

impl Blocker[src]

pub fn check(&self, request: &Request) -> BlockerResult[src]

Decide if a network request (usually from WebRequest API) should be blocked, redirected or allowed.

pub fn check_generic_hide(&self, hostname_request: &Request) -> bool[src]

pub fn check_parameterised(
    &self,
    request: &Request,
    matched_rule: bool,
    force_check_exceptions: bool
) -> BlockerResult
[src]

pub fn get_csp_directives(&self, _request: Request) -> Option<String>[src]

Given a "main_frame" request, check if some content security policies should be injected in the page.

pub fn new(
    network_filters: Vec<NetworkFilter>,
    options: &BlockerOptions
) -> Blocker
[src]

pub fn optimize(&mut self)[src]

If optimizations are enabled, the Blocker will be configured to automatically optimize its filters after batch updates. However, even if they are disabled, it is possible to manually call optimize(). It may be useful to have finer-grained control over optimization scheduling when frequently updating filters.

pub fn filter_exists(&self, filter: &NetworkFilter) -> bool[src]

pub fn add_filter(&mut self, filter: NetworkFilter) -> Result<(), BlockerError>[src]

pub fn use_tags(&mut self, tags: &[&str])[src]

pub fn enable_tags(&mut self, tags: &[&str])[src]

pub fn disable_tags(&mut self, tags: &[&str])[src]

pub fn tags_enabled(&self) -> Vec<String>[src]

pub fn use_resources(&mut self, resources: &[Resource])[src]

pub fn add_resource(&mut self, resource: &Resource)[src]

pub fn get_resource(&self, key: &str) -> Option<&RedirectResource>[src]

Auto Trait Implementations

impl RefUnwindSafe for Blocker

impl Send for Blocker

impl Sync for Blocker

impl Unpin for Blocker

impl UnwindSafe for Blocker

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.