[][src]Struct adblock::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. The debug argument 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: &str
) -> PyResult<()>
[src]

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

The format is a string containing either "standard" (ABP/uBO-style) or "hosts".

pub fn add_filters(
    &mut self,
    filters: Vec<String>,
    format: &str
) -> PyResult<()>
[src]

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

The format is a string containing either "standard" (ABP/uBO-style) or "hosts".

Trait Implementations

impl Clone for FilterSet[src]

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

type Target = PyRef<'a, FilterSet>

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

impl HasMethodsInventory for FilterSet[src]

type Methods = Pyo3MethodsInventoryForFilterSet

impl HasProtoRegistry for FilterSet[src]

impl IntoPy<PyObject> for FilterSet[src]

impl PyClass for FilterSet[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 FilterSet[src]

impl PyClassSend for FilterSet[src]

type ThreadChecker = ThreadCheckerStub<FilterSet>

impl PyTypeInfo for FilterSet[src]

type Type = FilterSet

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 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> FromPy<T> for T[src]

impl<'a, T> FromPyObject<'a> for T where
    T: PyClass + Clone
[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> 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.