[−][src]Struct adblock::blocker::Blocker
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]
&self,
request: &Request,
matched_rule: bool,
force_check_exceptions: bool
) -> BlockerResult
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]
network_filters: Vec<NetworkFilter>,
options: &BlockerOptions
) -> Blocker
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,