[−][src]Struct adblock::BlockerResult
The result of an ad-blocking check.
Fields
matched: bool
explicit_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 not None
.
The redirect
field contains the body of the redirect to be injected.
exception: Option<String>
Exception is not None
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 not None
.
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
check_network_urls
method.
Trait Implementations
impl<'a> ExtractExt<'a> for &'a BlockerResult
[src]
type Target = PyRef<'a, BlockerResult>
impl<'a> ExtractExt<'a> for &'a mut BlockerResult
[src]
type Target = PyRefMut<'a, BlockerResult>
impl HasMethodsInventory for BlockerResult
[src]
type Methods = Pyo3MethodsInventoryForBlockerResult
impl HasProtoRegistry for BlockerResult
[src]
impl Into<BlockerResult> for RustBlockerResult
[src]
fn into(self) -> BlockerResult
[src]
impl IntoPy<PyObject> for BlockerResult
[src]
impl PyClass for BlockerResult
[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 BlockerResult
[src]
unsafe fn new(py: Python<'_>, subtype: *mut PyTypeObject) -> *mut Self::Layout
[src]
unsafe fn dealloc(py: Python<'_>, self_: *mut Self::Layout)
[src]
impl PyClassSend for BlockerResult
[src]
type ThreadChecker = ThreadCheckerStub<BlockerResult>
impl<'p> PyObjectProtocol<'p> for BlockerResult
[src]
fn __repr__(&'p self) -> <BlockerResult as PyObjectReprProtocol<'p>>::Result
[src]
fn __getattr__(&'p self, name: Self::Name) -> Self::Result where
Self: PyObjectGetAttrProtocol<'p>,
[src]
Self: PyObjectGetAttrProtocol<'p>,
fn __setattr__(
&'p mut self,
name: Self::Name,
value: Self::Value
) -> Self::Result where
Self: PyObjectSetAttrProtocol<'p>,
[src]
&'p mut self,
name: Self::Name,
value: Self::Value
) -> Self::Result where
Self: PyObjectSetAttrProtocol<'p>,
fn __delattr__(&'p mut self, name: Self::Name) -> Self::Result where
Self: PyObjectDelAttrProtocol<'p>,
[src]
Self: PyObjectDelAttrProtocol<'p>,
fn __str__(&'p self) -> Self::Result where
Self: PyObjectStrProtocol<'p>,
[src]
Self: PyObjectStrProtocol<'p>,
fn __format__(&'p self, format_spec: Self::Format) -> Self::Result where
Self: PyObjectFormatProtocol<'p>,
[src]
Self: PyObjectFormatProtocol<'p>,
fn __hash__(&'p self) -> Self::Result where
Self: PyObjectHashProtocol<'p>,
[src]
Self: PyObjectHashProtocol<'p>,
fn __bytes__(&'p self) -> Self::Result where
Self: PyObjectBytesProtocol<'p>,
[src]
Self: PyObjectBytesProtocol<'p>,
fn __richcmp__(&'p self, other: Self::Other, op: CompareOp) -> Self::Result where
Self: PyObjectRichcmpProtocol<'p>,
[src]
Self: PyObjectRichcmpProtocol<'p>,
fn __bool__(&'p self) -> Self::Result where
Self: PyObjectBoolProtocol<'p>,
[src]
Self: PyObjectBoolProtocol<'p>,
impl<'p> PyObjectReprProtocol<'p> for BlockerResult
[src]
impl PyTypeInfo for BlockerResult
[src]
type Type = BlockerResult
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
const NAME: &'static str
[src]
const MODULE: Option<&'static str>
[src]
const DESCRIPTION: &'static str
[src]
const FLAGS: usize
[src]
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
[src]
fn is_instance(object: &PyAny) -> bool
[src]
fn is_exact_instance(object: &PyAny) -> bool
[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]
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> FromPy<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoPy<U> for T where
U: FromPy<T>,
[src]
U: FromPy<T>,
impl<T> PyClassAlloc for T where
T: PyTypeInfo + PyClassWithFreeList,
[src]
T: PyTypeInfo + PyClassWithFreeList,
unsafe fn new(
py: Python<'_>,
subtype: *mut PyTypeObject
) -> *mut <T as PyTypeInfo>::Layout
[src]
py: Python<'_>,
subtype: *mut PyTypeObject
) -> *mut <T as PyTypeInfo>::Layout
unsafe fn dealloc(py: Python<'_>, self_: *mut <T as PyTypeInfo>::Layout)
[src]
impl<T> PyMethods for T where
T: HasMethodsInventory,
[src]
T: HasMethodsInventory,
fn py_methods() -> Vec<&'static PyMethodDefType>
[src]
impl<T> PyProtoMethods for T where
T: HasProtoRegistry,
[src]
T: HasProtoRegistry,
fn async_methods() -> Option<NonNull<PyAsyncMethods>>
[src]
fn basic_methods() -> Option<NonNull<PyObjectMethods>>
[src]
fn buffer_methods() -> Option<NonNull<PyBufferProcs>>
[src]
fn descr_methods() -> Option<NonNull<PyDescrMethods>>
[src]
fn gc_methods() -> Option<NonNull<PyGCMethods>>
[src]
fn mapping_methods() -> Option<NonNull<PyMappingMethods>>
[src]
fn number_methods() -> Option<NonNull<PyNumberMethods>>
[src]
fn iter_methods() -> Option<NonNull<PyIterMethods>>
[src]
fn sequence_methods() -> Option<NonNull<PySequenceMethods>>
[src]
impl<T> PyTypeObject for T where
T: PyTypeInfo,
[src]
T: PyTypeInfo,
fn type_object(py: Python<'_>) -> &PyType
[src]
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>,