[][src]Struct adblock::lists::FilterSet

pub struct FilterSet { /* fields omitted */ }

Manages a set of rules to be added to an Engine.

To be able to efficiently handle special options like $badfilter, and to allow optimizations, all rules must be available when the Engine is first created. FilterSet allows assembling a compound list from multiple different sources before compiling the rules into an Engine.

Implementations

impl FilterSet[src]

pub fn new(debug: bool) -> Self[src]

Creates a new FilterSet. debug specifies whether or not to save information about the original raw filter rules alongside the more compact internal representation. If enabled, this information will be passed to the corresponding Engine.

pub fn add_filter_list(&mut self, filter_list: &str, format: FilterFormat)[src]

Adds the contents of an entire filter list to this FilterSet. Filters that cannot be parsed successfully are ignored.

pub fn add_filters(&mut self, filters: &[String], format: FilterFormat)[src]

Adds a collection of filter rules to this FilterSet. Filters that cannot be parsed successfully are ignored.

pub fn add_filter(
    &mut self,
    filter: &str,
    format: FilterFormat
) -> Result<(), FilterParseError>
[src]

Adds the string representation of a single filter rule to this FilterSet.

Trait Implementations

impl Clone for FilterSet[src]

impl Default for FilterSet[src]

fn default() -> Self[src]

Equivalent to FilterSet::new(false), or FilterSet::new(true) when compiled in test configuration.

Auto Trait Implementations

impl RefUnwindSafe for FilterSet

impl Send for FilterSet

impl Sync for FilterSet

impl Unpin for FilterSet

impl UnwindSafe for FilterSet

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.