Struct adblock::filters::network::NetworkFilterMask
source · pub struct NetworkFilterMask { /* private fields */ }
Implementations§
source§impl NetworkFilterMask
impl NetworkFilterMask
pub const FROM_IMAGE: Self = _
pub const FROM_MEDIA: Self = _
pub const FROM_OBJECT: Self = _
pub const FROM_OTHER: Self = _
pub const FROM_PING: Self = _
pub const FROM_SCRIPT: Self = _
pub const FROM_STYLESHEET: Self = _
pub const FROM_SUBDOCUMENT: Self = _
pub const FROM_WEBSOCKET: Self = _
pub const FROM_XMLHTTPREQUEST: Self = _
pub const FROM_FONT: Self = _
pub const FROM_HTTP: Self = _
pub const FROM_HTTPS: Self = _
pub const IS_IMPORTANT: Self = _
pub const MATCH_CASE: Self = _
pub const IS_REMOVEPARAM: Self = _
pub const THIRD_PARTY: Self = _
pub const FIRST_PARTY: Self = _
pub const IS_REDIRECT: Self = _
pub const BAD_FILTER: Self = _
pub const GENERIC_HIDE: Self = _
pub const FROM_DOCUMENT: Self = _
pub const IS_REGEX: Self = _
pub const IS_LEFT_ANCHOR: Self = _
pub const IS_RIGHT_ANCHOR: Self = _
pub const IS_HOSTNAME_ANCHOR: Self = _
pub const IS_EXCEPTION: Self = _
pub const IS_CSP: Self = _
pub const IS_COMPLETE_REGEX: Self = _
pub const IS_HOSTNAME_REGEX: Self = _
pub const ALSO_BLOCK_REDIRECT: Self = _
pub const UNMATCHED: Self = _
pub const FROM_NETWORK_TYPES: Self = _
pub const FROM_ALL_TYPES: Self = _
pub const DEFAULT_OPTIONS: Self = _
pub const NONE: Self = _
sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Self
pub const unsafe fn from_bits_unchecked(bits: u32) -> Self
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
source§impl Binary for NetworkFilterMask
impl Binary for NetworkFilterMask
source§impl BitAnd for NetworkFilterMask
impl BitAnd for NetworkFilterMask
source§impl BitAndAssign for NetworkFilterMask
impl BitAndAssign for NetworkFilterMask
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
source§impl BitOr for NetworkFilterMask
impl BitOr for NetworkFilterMask
source§fn bitor(self, other: NetworkFilterMask) -> Self
fn bitor(self, other: NetworkFilterMask) -> Self
Returns the union of the two sets of flags.
§type Output = NetworkFilterMask
type Output = NetworkFilterMask
|
operator.source§impl BitOrAssign for NetworkFilterMask
impl BitOrAssign for NetworkFilterMask
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
source§impl BitXor for NetworkFilterMask
impl BitXor for NetworkFilterMask
source§impl BitXorAssign for NetworkFilterMask
impl BitXorAssign for NetworkFilterMask
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
source§impl Clone for NetworkFilterMask
impl Clone for NetworkFilterMask
source§fn clone(&self) -> NetworkFilterMask
fn clone(&self) -> NetworkFilterMask
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NetworkFilterMask
impl Debug for NetworkFilterMask
source§impl<'de> Deserialize<'de> for NetworkFilterMask
impl<'de> Deserialize<'de> for NetworkFilterMask
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for NetworkFilterMask
impl Display for NetworkFilterMask
source§impl Extend<NetworkFilterMask> for NetworkFilterMask
impl Extend<NetworkFilterMask> for NetworkFilterMask
source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl From<&RequestType> for NetworkFilterMask
impl From<&RequestType> for NetworkFilterMask
source§fn from(request_type: &RequestType) -> NetworkFilterMask
fn from(request_type: &RequestType) -> NetworkFilterMask
source§impl FromIterator<NetworkFilterMask> for NetworkFilterMask
impl FromIterator<NetworkFilterMask> for NetworkFilterMask
source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
source§impl Hash for NetworkFilterMask
impl Hash for NetworkFilterMask
source§impl LowerHex for NetworkFilterMask
impl LowerHex for NetworkFilterMask
source§impl Not for NetworkFilterMask
impl Not for NetworkFilterMask
source§impl Octal for NetworkFilterMask
impl Octal for NetworkFilterMask
source§impl Ord for NetworkFilterMask
impl Ord for NetworkFilterMask
source§fn cmp(&self, other: &NetworkFilterMask) -> Ordering
fn cmp(&self, other: &NetworkFilterMask) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for NetworkFilterMask
impl PartialEq for NetworkFilterMask
source§fn eq(&self, other: &NetworkFilterMask) -> bool
fn eq(&self, other: &NetworkFilterMask) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for NetworkFilterMask
impl PartialOrd for NetworkFilterMask
source§fn partial_cmp(&self, other: &NetworkFilterMask) -> Option<Ordering>
fn partial_cmp(&self, other: &NetworkFilterMask) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for NetworkFilterMask
impl Serialize for NetworkFilterMask
source§impl Sub for NetworkFilterMask
impl Sub for NetworkFilterMask
source§impl SubAssign for NetworkFilterMask
impl SubAssign for NetworkFilterMask
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.