Struct net::wire::NdiscNeighborFlags
pub struct NdiscNeighborFlags { /* private fields */ }Implementations§
§impl NeighborFlags
impl NeighborFlags
pub const ROUTER: NeighborFlags = _
pub const SOLICITED: NeighborFlags = _
pub const OVERRIDE: NeighborFlags = _
pub const fn empty() -> NeighborFlags
pub const fn empty() -> NeighborFlags
Returns an empty set of flags.
pub const fn all() -> NeighborFlags
pub const fn all() -> NeighborFlags
Returns the set containing all flags.
pub const fn from_bits(bits: u8) -> Option<NeighborFlags>
pub const fn from_bits(bits: u8) -> Option<NeighborFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u8) -> NeighborFlags
pub const fn from_bits_truncate(bits: u8) -> NeighborFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u8) -> NeighborFlags
pub const unsafe fn from_bits_unchecked(bits: u8) -> NeighborFlags
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.
pub const fn intersects(&self, other: NeighborFlags) -> bool
pub const fn intersects(&self, other: NeighborFlags) -> bool
Returns true if there are flags common to both self and other.
pub const fn contains(&self, other: NeighborFlags) -> bool
pub const fn contains(&self, other: NeighborFlags) -> bool
Returns true if all of the flags in other are contained within self.
pub fn insert(&mut self, other: NeighborFlags)
pub fn insert(&mut self, other: NeighborFlags)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: NeighborFlags)
pub fn remove(&mut self, other: NeighborFlags)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: NeighborFlags)
pub fn toggle(&mut self, other: NeighborFlags)
Toggles the specified flags in-place.
pub fn set(&mut self, other: NeighborFlags, value: bool)
pub fn set(&mut self, other: NeighborFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
pub const fn intersection(self, other: NeighborFlags) -> NeighborFlags
pub const fn intersection(self, other: NeighborFlags) -> NeighborFlags
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.
pub const fn union(self, other: NeighborFlags) -> NeighborFlags
pub const fn union(self, other: NeighborFlags) -> NeighborFlags
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.
pub const fn difference(self, other: NeighborFlags) -> NeighborFlags
pub const fn difference(self, other: NeighborFlags) -> NeighborFlags
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.
pub const fn symmetric_difference(self, other: NeighborFlags) -> NeighborFlags
pub const fn symmetric_difference(self, other: NeighborFlags) -> NeighborFlags
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.
pub const fn complement(self) -> NeighborFlags
pub const fn complement(self) -> NeighborFlags
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§
§impl Binary for NeighborFlags
impl Binary for NeighborFlags
§impl BitAnd<NeighborFlags> for NeighborFlags
impl BitAnd<NeighborFlags> for NeighborFlags
§fn bitand(self, other: NeighborFlags) -> NeighborFlags
fn bitand(self, other: NeighborFlags) -> NeighborFlags
Returns the intersection between the two sets of flags.
§type Output = NeighborFlags
type Output = NeighborFlags
& operator.§impl BitAndAssign<NeighborFlags> for NeighborFlags
impl BitAndAssign<NeighborFlags> for NeighborFlags
§fn bitand_assign(&mut self, other: NeighborFlags)
fn bitand_assign(&mut self, other: NeighborFlags)
Disables all flags disabled in the set.
§impl BitOr<NeighborFlags> for NeighborFlags
impl BitOr<NeighborFlags> for NeighborFlags
§fn bitor(self, other: NeighborFlags) -> NeighborFlags
fn bitor(self, other: NeighborFlags) -> NeighborFlags
Returns the union of the two sets of flags.
§type Output = NeighborFlags
type Output = NeighborFlags
| operator.§impl BitOrAssign<NeighborFlags> for NeighborFlags
impl BitOrAssign<NeighborFlags> for NeighborFlags
§fn bitor_assign(&mut self, other: NeighborFlags)
fn bitor_assign(&mut self, other: NeighborFlags)
Adds the set of flags.
§impl BitXor<NeighborFlags> for NeighborFlags
impl BitXor<NeighborFlags> for NeighborFlags
§fn bitxor(self, other: NeighborFlags) -> NeighborFlags
fn bitxor(self, other: NeighborFlags) -> NeighborFlags
Returns the left flags, but with all the right flags toggled.
§type Output = NeighborFlags
type Output = NeighborFlags
^ operator.§impl BitXorAssign<NeighborFlags> for NeighborFlags
impl BitXorAssign<NeighborFlags> for NeighborFlags
§fn bitxor_assign(&mut self, other: NeighborFlags)
fn bitxor_assign(&mut self, other: NeighborFlags)
Toggles the set of flags.
§impl Clone for NeighborFlags
impl Clone for NeighborFlags
§fn clone(&self) -> NeighborFlags
fn clone(&self) -> NeighborFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for NeighborFlags
impl Debug for NeighborFlags
§impl Extend<NeighborFlags> for NeighborFlags
impl Extend<NeighborFlags> for NeighborFlags
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = NeighborFlags>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = NeighborFlags>,
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)§impl FromIterator<NeighborFlags> for NeighborFlags
impl FromIterator<NeighborFlags> for NeighborFlags
§fn from_iter<T>(iterator: T) -> NeighborFlagswhere
T: IntoIterator<Item = NeighborFlags>,
fn from_iter<T>(iterator: T) -> NeighborFlagswhere T: IntoIterator<Item = NeighborFlags>,
§impl Hash for NeighborFlags
impl Hash for NeighborFlags
§impl LowerHex for NeighborFlags
impl LowerHex for NeighborFlags
§impl Not for NeighborFlags
impl Not for NeighborFlags
§fn not(self) -> NeighborFlags
fn not(self) -> NeighborFlags
Returns the complement of this set of flags.
§type Output = NeighborFlags
type Output = NeighborFlags
! operator.§impl Octal for NeighborFlags
impl Octal for NeighborFlags
§impl Ord for NeighborFlags
impl Ord for NeighborFlags
§impl PartialEq<NeighborFlags> for NeighborFlags
impl PartialEq<NeighborFlags> for NeighborFlags
§fn eq(&self, other: &NeighborFlags) -> bool
fn eq(&self, other: &NeighborFlags) -> bool
self and other values to be equal, and is used
by ==.§impl PartialOrd<NeighborFlags> for NeighborFlags
impl PartialOrd<NeighborFlags> for NeighborFlags
§fn partial_cmp(&self, other: &NeighborFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &NeighborFlags) -> 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 more§impl Sub<NeighborFlags> for NeighborFlags
impl Sub<NeighborFlags> for NeighborFlags
§fn sub(self, other: NeighborFlags) -> NeighborFlags
fn sub(self, other: NeighborFlags) -> NeighborFlags
Returns the set difference of the two sets of flags.
§type Output = NeighborFlags
type Output = NeighborFlags
- operator.§impl SubAssign<NeighborFlags> for NeighborFlags
impl SubAssign<NeighborFlags> for NeighborFlags
§fn sub_assign(&mut self, other: NeighborFlags)
fn sub_assign(&mut self, other: NeighborFlags)
Disables all flags enabled in the set.