pub struct CapabilityFlags(/* private fields */);Implementations§
Source§impl CapabilityFlags
impl CapabilityFlags
Sourcepub const Executable: CapabilityFlags
pub const Executable: CapabilityFlags
Memory can be used for code execution.
Sourcepub const DirectMemoryAccess: CapabilityFlags
pub const DirectMemoryAccess: CapabilityFlags
Memory can be read and written by DMA controllers (subject to platform alignment constraints).
Sourcepub const AlwaysAccessible: CapabilityFlags
pub const AlwaysAccessible: CapabilityFlags
Memory remains CPU-accessible while external flash caches are disabled.
Source§impl CapabilityFlags
impl CapabilityFlags
Sourcepub const fn empty() -> CapabilityFlags
pub const fn empty() -> CapabilityFlags
Get a flags value with all bits unset.
Sourcepub const fn all() -> CapabilityFlags
pub const fn all() -> CapabilityFlags
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<CapabilityFlags>
pub const fn from_bits(bits: u8) -> Option<CapabilityFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u8) -> CapabilityFlags
pub const fn from_bits_truncate(bits: u8) -> CapabilityFlags
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u8) -> CapabilityFlags
pub const fn from_bits_retain(bits: u8) -> CapabilityFlags
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<CapabilityFlags>
pub fn from_name(name: &str) -> Option<CapabilityFlags>
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: CapabilityFlags) -> bool
pub const fn intersects(&self, other: CapabilityFlags) -> bool
Whether any set bits in other are also set in self.
Sourcepub const fn contains(&self, other: CapabilityFlags) -> bool
pub const fn contains(&self, other: CapabilityFlags) -> bool
Whether all set bits in other are also set in self.
Sourcepub fn insert(&mut self, other: CapabilityFlags)
pub fn insert(&mut self, other: CapabilityFlags)
The bitwise or (|) of the bits in self and other.
Sourcepub fn remove(&mut self, other: CapabilityFlags)
pub fn remove(&mut self, other: CapabilityFlags)
The intersection of self with the complement of other (&!).
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: CapabilityFlags)
pub fn toggle(&mut self, other: CapabilityFlags)
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub fn set(&mut self, other: CapabilityFlags, value: bool)
pub fn set(&mut self, other: CapabilityFlags, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: CapabilityFlags) -> CapabilityFlags
pub const fn intersection(self, other: CapabilityFlags) -> CapabilityFlags
The bitwise and (&) of the bits in self and other.
Sourcepub const fn union(self, other: CapabilityFlags) -> CapabilityFlags
pub const fn union(self, other: CapabilityFlags) -> CapabilityFlags
The bitwise or (|) of the bits in self and other.
Sourcepub const fn difference(self, other: CapabilityFlags) -> CapabilityFlags
pub const fn difference(self, other: CapabilityFlags) -> CapabilityFlags
The intersection of self with the complement of other (&!).
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: CapabilityFlags,
) -> CapabilityFlags
pub const fn symmetric_difference( self, other: CapabilityFlags, ) -> CapabilityFlags
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub const fn complement(self) -> CapabilityFlags
pub const fn complement(self) -> CapabilityFlags
The bitwise negation (!) of the bits in self, truncating the result.
Source§impl CapabilityFlags
impl CapabilityFlags
Sourcepub const fn iter(&self) -> Iter<CapabilityFlags>
pub const fn iter(&self) -> Iter<CapabilityFlags>
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<CapabilityFlags>
pub const fn iter_names(&self) -> IterNames<CapabilityFlags>
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 CapabilityFlags
impl Binary for CapabilityFlags
Source§impl BitAnd for CapabilityFlags
impl BitAnd for CapabilityFlags
Source§fn bitand(self, other: CapabilityFlags) -> CapabilityFlags
fn bitand(self, other: CapabilityFlags) -> CapabilityFlags
The bitwise and (&) of the bits in self and other.
Source§type Output = CapabilityFlags
type Output = CapabilityFlags
& operator.Source§impl BitAndAssign for CapabilityFlags
impl BitAndAssign for CapabilityFlags
Source§fn bitand_assign(&mut self, other: CapabilityFlags)
fn bitand_assign(&mut self, other: CapabilityFlags)
The bitwise and (&) of the bits in self and other.
Source§impl BitOr for CapabilityFlags
impl BitOr for CapabilityFlags
Source§fn bitor(self, other: CapabilityFlags) -> CapabilityFlags
fn bitor(self, other: CapabilityFlags) -> CapabilityFlags
The bitwise or (|) of the bits in self and other.
Source§type Output = CapabilityFlags
type Output = CapabilityFlags
| operator.Source§impl BitOrAssign for CapabilityFlags
impl BitOrAssign for CapabilityFlags
Source§fn bitor_assign(&mut self, other: CapabilityFlags)
fn bitor_assign(&mut self, other: CapabilityFlags)
The bitwise or (|) of the bits in self and other.
Source§impl BitXor for CapabilityFlags
impl BitXor for CapabilityFlags
Source§fn bitxor(self, other: CapabilityFlags) -> CapabilityFlags
fn bitxor(self, other: CapabilityFlags) -> CapabilityFlags
The bitwise exclusive-or (^) of the bits in self and other.
Source§type Output = CapabilityFlags
type Output = CapabilityFlags
^ operator.Source§impl BitXorAssign for CapabilityFlags
impl BitXorAssign for CapabilityFlags
Source§fn bitxor_assign(&mut self, other: CapabilityFlags)
fn bitxor_assign(&mut self, other: CapabilityFlags)
The bitwise exclusive-or (^) of the bits in self and other.
Source§impl Clone for CapabilityFlags
impl Clone for CapabilityFlags
Source§fn clone(&self) -> CapabilityFlags
fn clone(&self) -> CapabilityFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CapabilityFlags
impl Debug for CapabilityFlags
Source§impl Extend<CapabilityFlags> for CapabilityFlags
impl Extend<CapabilityFlags> for CapabilityFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = CapabilityFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = CapabilityFlags>,
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 CapabilityFlags
impl Flags for CapabilityFlags
Source§const FLAGS: &'static [Flag<CapabilityFlags>]
const FLAGS: &'static [Flag<CapabilityFlags>]
Source§fn from_bits_retain(bits: u8) -> CapabilityFlags
fn from_bits_retain(bits: u8) -> CapabilityFlags
Source§fn all_named() -> CapabilityFlags
fn all_named() -> CapabilityFlags
§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS].§fn iter_equal_names(&self) -> IterEqualNames<Self>
fn iter_equal_names(&self) -> IterEqualNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.Source§impl FromIterator<CapabilityFlags> for CapabilityFlags
impl FromIterator<CapabilityFlags> for CapabilityFlags
Source§fn from_iter<T>(iterator: T) -> CapabilityFlagswhere
T: IntoIterator<Item = CapabilityFlags>,
fn from_iter<T>(iterator: T) -> CapabilityFlagswhere
T: IntoIterator<Item = CapabilityFlags>,
The bitwise or (|) of the bits in each flags value.
Source§impl IntoIterator for CapabilityFlags
impl IntoIterator for CapabilityFlags
Source§type Item = CapabilityFlags
type Item = CapabilityFlags
Source§type IntoIter = Iter<CapabilityFlags>
type IntoIter = Iter<CapabilityFlags>
Source§fn into_iter(self) -> <CapabilityFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <CapabilityFlags as IntoIterator>::IntoIter
Source§impl LowerHex for CapabilityFlags
impl LowerHex for CapabilityFlags
Source§impl Not for CapabilityFlags
impl Not for CapabilityFlags
Source§fn not(self) -> CapabilityFlags
fn not(self) -> CapabilityFlags
The bitwise negation (!) of the bits in self, truncating the result.
Source§type Output = CapabilityFlags
type Output = CapabilityFlags
! operator.Source§impl Octal for CapabilityFlags
impl Octal for CapabilityFlags
Source§impl PartialEq for CapabilityFlags
impl PartialEq for CapabilityFlags
Source§fn eq(&self, other: &CapabilityFlags) -> bool
fn eq(&self, other: &CapabilityFlags) -> bool
self and other values to be equal, and is used by ==.Source§impl Sub for CapabilityFlags
impl Sub for CapabilityFlags
Source§fn sub(self, other: CapabilityFlags) -> CapabilityFlags
fn sub(self, other: CapabilityFlags) -> CapabilityFlags
The intersection of self with the complement of other (&!).
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 = CapabilityFlags
type Output = CapabilityFlags
- operator.Source§impl SubAssign for CapabilityFlags
impl SubAssign for CapabilityFlags
Source§fn sub_assign(&mut self, other: CapabilityFlags)
fn sub_assign(&mut self, other: CapabilityFlags)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.