pub struct ConfigurationOptionFlags(/* private fields */);
Expand description
Service Discovery configuration option flags.
Implementations§
Source§impl ConfigurationOptionFlags
impl ConfigurationOptionFlags
Sourcepub const DISCARDABLE: ConfigurationOptionFlags
pub const DISCARDABLE: ConfigurationOptionFlags
Shall be set to 1 if the Option can be discarded by the receiver.
Source§impl ConfigurationOptionFlags
impl ConfigurationOptionFlags
Sourcepub const fn empty() -> ConfigurationOptionFlags
pub const fn empty() -> ConfigurationOptionFlags
Get a flags value with all bits unset.
Sourcepub const fn all() -> ConfigurationOptionFlags
pub const fn all() -> ConfigurationOptionFlags
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u8
pub const fn bits(&self) -> u8
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u8) -> Option<ConfigurationOptionFlags>
pub const fn from_bits(bits: u8) -> Option<ConfigurationOptionFlags>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u8) -> ConfigurationOptionFlags
pub const fn from_bits_truncate(bits: u8) -> ConfigurationOptionFlags
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u8) -> ConfigurationOptionFlags
pub const fn from_bits_retain(bits: u8) -> ConfigurationOptionFlags
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<ConfigurationOptionFlags>
pub fn from_name(name: &str) -> Option<ConfigurationOptionFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: ConfigurationOptionFlags) -> bool
pub const fn intersects(&self, other: ConfigurationOptionFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: ConfigurationOptionFlags) -> bool
pub const fn contains(&self, other: ConfigurationOptionFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: ConfigurationOptionFlags)
pub fn insert(&mut self, other: ConfigurationOptionFlags)
The bitwise or (|
) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: ConfigurationOptionFlags)
pub fn remove(&mut self, other: ConfigurationOptionFlags)
The intersection of a source flags value with the complement of a target flags
value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: ConfigurationOptionFlags)
pub fn toggle(&mut self, other: ConfigurationOptionFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: ConfigurationOptionFlags, value: bool)
pub fn set(&mut self, other: ConfigurationOptionFlags, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(
self,
other: ConfigurationOptionFlags,
) -> ConfigurationOptionFlags
pub const fn intersection( self, other: ConfigurationOptionFlags, ) -> ConfigurationOptionFlags
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(
self,
other: ConfigurationOptionFlags,
) -> ConfigurationOptionFlags
pub const fn union( self, other: ConfigurationOptionFlags, ) -> ConfigurationOptionFlags
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(
self,
other: ConfigurationOptionFlags,
) -> ConfigurationOptionFlags
pub const fn difference( self, other: ConfigurationOptionFlags, ) -> ConfigurationOptionFlags
The intersection of a source flags value with the complement of a target flags
value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(
self,
other: ConfigurationOptionFlags,
) -> ConfigurationOptionFlags
pub const fn symmetric_difference( self, other: ConfigurationOptionFlags, ) -> ConfigurationOptionFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> ConfigurationOptionFlags
pub const fn complement(self) -> ConfigurationOptionFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl ConfigurationOptionFlags
impl ConfigurationOptionFlags
Sourcepub const fn iter(&self) -> Iter<ConfigurationOptionFlags>
pub const fn iter(&self) -> Iter<ConfigurationOptionFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<ConfigurationOptionFlags>
pub const fn iter_names(&self) -> IterNames<ConfigurationOptionFlags>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for ConfigurationOptionFlags
impl Binary for ConfigurationOptionFlags
Source§impl BitAnd for ConfigurationOptionFlags
impl BitAnd for ConfigurationOptionFlags
Source§fn bitand(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
fn bitand(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
The bitwise and (&
) of the bits in two flags values.
Source§type Output = ConfigurationOptionFlags
type Output = ConfigurationOptionFlags
&
operator.Source§impl BitAndAssign for ConfigurationOptionFlags
impl BitAndAssign for ConfigurationOptionFlags
Source§fn bitand_assign(&mut self, other: ConfigurationOptionFlags)
fn bitand_assign(&mut self, other: ConfigurationOptionFlags)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOr for ConfigurationOptionFlags
impl BitOr for ConfigurationOptionFlags
Source§fn bitor(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
fn bitor(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
The bitwise or (|
) of the bits in two flags values.
Source§type Output = ConfigurationOptionFlags
type Output = ConfigurationOptionFlags
|
operator.Source§impl BitOrAssign for ConfigurationOptionFlags
impl BitOrAssign for ConfigurationOptionFlags
Source§fn bitor_assign(&mut self, other: ConfigurationOptionFlags)
fn bitor_assign(&mut self, other: ConfigurationOptionFlags)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXor for ConfigurationOptionFlags
impl BitXor for ConfigurationOptionFlags
Source§fn bitxor(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
fn bitxor(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§type Output = ConfigurationOptionFlags
type Output = ConfigurationOptionFlags
^
operator.Source§impl BitXorAssign for ConfigurationOptionFlags
impl BitXorAssign for ConfigurationOptionFlags
Source§fn bitxor_assign(&mut self, other: ConfigurationOptionFlags)
fn bitxor_assign(&mut self, other: ConfigurationOptionFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Clone for ConfigurationOptionFlags
impl Clone for ConfigurationOptionFlags
Source§fn clone(&self) -> ConfigurationOptionFlags
fn clone(&self) -> ConfigurationOptionFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConfigurationOptionFlags
impl Debug for ConfigurationOptionFlags
Source§impl Extend<ConfigurationOptionFlags> for ConfigurationOptionFlags
impl Extend<ConfigurationOptionFlags> for ConfigurationOptionFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ConfigurationOptionFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ConfigurationOptionFlags>,
The bitwise or (|
) of the bits in each flags value.
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 Flags for ConfigurationOptionFlags
impl Flags for ConfigurationOptionFlags
Source§const FLAGS: &'static [Flag<ConfigurationOptionFlags>]
const FLAGS: &'static [Flag<ConfigurationOptionFlags>]
Source§fn from_bits_retain(bits: u8) -> ConfigurationOptionFlags
fn from_bits_retain(bits: u8) -> ConfigurationOptionFlags
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<ConfigurationOptionFlags> for ConfigurationOptionFlags
impl FromIterator<ConfigurationOptionFlags> for ConfigurationOptionFlags
Source§fn from_iter<T>(iterator: T) -> ConfigurationOptionFlagswhere
T: IntoIterator<Item = ConfigurationOptionFlags>,
fn from_iter<T>(iterator: T) -> ConfigurationOptionFlagswhere
T: IntoIterator<Item = ConfigurationOptionFlags>,
The bitwise or (|
) of the bits in each flags value.
Source§impl IntoIterator for ConfigurationOptionFlags
impl IntoIterator for ConfigurationOptionFlags
Source§type Item = ConfigurationOptionFlags
type Item = ConfigurationOptionFlags
Source§type IntoIter = Iter<ConfigurationOptionFlags>
type IntoIter = Iter<ConfigurationOptionFlags>
Source§fn into_iter(self) -> <ConfigurationOptionFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <ConfigurationOptionFlags as IntoIterator>::IntoIter
Source§impl LowerHex for ConfigurationOptionFlags
impl LowerHex for ConfigurationOptionFlags
Source§impl Not for ConfigurationOptionFlags
impl Not for ConfigurationOptionFlags
Source§fn not(self) -> ConfigurationOptionFlags
fn not(self) -> ConfigurationOptionFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§type Output = ConfigurationOptionFlags
type Output = ConfigurationOptionFlags
!
operator.Source§impl Octal for ConfigurationOptionFlags
impl Octal for ConfigurationOptionFlags
Source§impl<'a> Parse<'a> for ConfigurationOptionFlags
impl<'a> Parse<'a> for ConfigurationOptionFlags
Source§fn parse_partial(
reader: &mut ByteReader<'a>,
) -> Result<ConfigurationOptionFlags, ParseError>
fn parse_partial( reader: &mut ByteReader<'a>, ) -> Result<ConfigurationOptionFlags, ParseError>
Source§impl PartialEq for ConfigurationOptionFlags
impl PartialEq for ConfigurationOptionFlags
Source§impl Serialize for ConfigurationOptionFlags
impl Serialize for ConfigurationOptionFlags
Source§fn required_length(&self) -> usize
fn required_length(&self) -> usize
Source§fn serialize_partial(
&self,
byte_writer: &mut ByteWriter<'_>,
) -> Result<(), SerializeError>
fn serialize_partial( &self, byte_writer: &mut ByteWriter<'_>, ) -> Result<(), SerializeError>
Source§impl Sub for ConfigurationOptionFlags
impl Sub for ConfigurationOptionFlags
Source§fn sub(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
fn sub(self, other: ConfigurationOptionFlags) -> ConfigurationOptionFlags
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§type Output = ConfigurationOptionFlags
type Output = ConfigurationOptionFlags
-
operator.Source§impl SubAssign for ConfigurationOptionFlags
impl SubAssign for ConfigurationOptionFlags
Source§fn sub_assign(&mut self, other: ConfigurationOptionFlags)
fn sub_assign(&mut self, other: ConfigurationOptionFlags)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.