pub struct AccessFlags(/* private fields */);Implementations§
Source§impl AccessFlags
impl AccessFlags
pub const READ: AccessFlags
pub const WRITE: AccessFlags
pub const EXECUTE: AccessFlags
pub const LOWER: AccessFlags
Source§impl AccessFlags
impl AccessFlags
Sourcepub const fn empty() -> AccessFlags
pub const fn empty() -> AccessFlags
Get a flags value with all bits unset.
Sourcepub const fn all() -> AccessFlags
pub const fn all() -> AccessFlags
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> usize
pub const fn bits(&self) -> usize
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: usize) -> Option<AccessFlags>
pub const fn from_bits(bits: usize) -> Option<AccessFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: usize) -> AccessFlags
pub const fn from_bits_truncate(bits: usize) -> AccessFlags
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: usize) -> AccessFlags
pub const fn from_bits_retain(bits: usize) -> AccessFlags
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<AccessFlags>
pub fn from_name(name: &str) -> Option<AccessFlags>
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: AccessFlags) -> bool
pub const fn intersects(&self, other: AccessFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: AccessFlags) -> bool
pub const fn contains(&self, other: AccessFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: AccessFlags)
pub fn insert(&mut self, other: AccessFlags)
The bitwise or (|) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: AccessFlags)
pub fn remove(&mut self, other: AccessFlags)
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: AccessFlags)
pub fn toggle(&mut self, other: AccessFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: AccessFlags, value: bool)
pub fn set(&mut self, other: AccessFlags, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: AccessFlags) -> AccessFlags
pub const fn intersection(self, other: AccessFlags) -> AccessFlags
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: AccessFlags) -> AccessFlags
pub const fn union(self, other: AccessFlags) -> AccessFlags
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: AccessFlags) -> AccessFlags
pub const fn difference(self, other: AccessFlags) -> AccessFlags
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: AccessFlags) -> AccessFlags
pub const fn symmetric_difference(self, other: AccessFlags) -> AccessFlags
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> AccessFlags
pub const fn complement(self) -> AccessFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl AccessFlags
impl AccessFlags
Sourcepub const fn iter(&self) -> Iter<AccessFlags>
pub const fn iter(&self) -> Iter<AccessFlags>
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<AccessFlags>
pub const fn iter_names(&self) -> IterNames<AccessFlags>
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 AccessFlags
impl Binary for AccessFlags
Source§impl BitAnd for AccessFlags
impl BitAnd for AccessFlags
Source§fn bitand(self, other: AccessFlags) -> AccessFlags
fn bitand(self, other: AccessFlags) -> AccessFlags
The bitwise and (&) of the bits in two flags values.
Source§type Output = AccessFlags
type Output = AccessFlags
& operator.Source§impl BitAndAssign for AccessFlags
impl BitAndAssign for AccessFlags
Source§fn bitand_assign(&mut self, other: AccessFlags)
fn bitand_assign(&mut self, other: AccessFlags)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for AccessFlags
impl BitOr for AccessFlags
Source§fn bitor(self, other: AccessFlags) -> AccessFlags
fn bitor(self, other: AccessFlags) -> AccessFlags
The bitwise or (|) of the bits in two flags values.
Source§type Output = AccessFlags
type Output = AccessFlags
| operator.Source§impl BitOrAssign for AccessFlags
impl BitOrAssign for AccessFlags
Source§fn bitor_assign(&mut self, other: AccessFlags)
fn bitor_assign(&mut self, other: AccessFlags)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for AccessFlags
impl BitXor for AccessFlags
Source§fn bitxor(self, other: AccessFlags) -> AccessFlags
fn bitxor(self, other: AccessFlags) -> AccessFlags
The bitwise exclusive-or (^) of the bits in two flags values.
Source§type Output = AccessFlags
type Output = AccessFlags
^ operator.Source§impl BitXorAssign for AccessFlags
impl BitXorAssign for AccessFlags
Source§fn bitxor_assign(&mut self, other: AccessFlags)
fn bitxor_assign(&mut self, other: AccessFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for AccessFlags
impl Clone for AccessFlags
Source§fn clone(&self) -> AccessFlags
fn clone(&self) -> AccessFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccessFlags
impl Debug for AccessFlags
Source§impl Extend<AccessFlags> for AccessFlags
impl Extend<AccessFlags> for AccessFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = AccessFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = AccessFlags>,
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 AccessFlags
impl Flags for AccessFlags
Source§const FLAGS: &'static [Flag<AccessFlags>]
const FLAGS: &'static [Flag<AccessFlags>]
Source§fn from_bits_retain(bits: usize) -> AccessFlags
fn from_bits_retain(bits: usize) -> AccessFlags
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 iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS.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<AccessFlags> for AccessFlags
impl FromIterator<AccessFlags> for AccessFlags
Source§fn from_iter<T>(iterator: T) -> AccessFlagswhere
T: IntoIterator<Item = AccessFlags>,
fn from_iter<T>(iterator: T) -> AccessFlagswhere
T: IntoIterator<Item = AccessFlags>,
The bitwise or (|) of the bits in each flags value.
Source§impl IntoIterator for AccessFlags
impl IntoIterator for AccessFlags
Source§type Item = AccessFlags
type Item = AccessFlags
Source§type IntoIter = Iter<AccessFlags>
type IntoIter = Iter<AccessFlags>
Source§fn into_iter(self) -> <AccessFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <AccessFlags as IntoIterator>::IntoIter
Source§impl LowerHex for AccessFlags
impl LowerHex for AccessFlags
Source§impl Not for AccessFlags
impl Not for AccessFlags
Source§fn not(self) -> AccessFlags
fn not(self) -> AccessFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§type Output = AccessFlags
type Output = AccessFlags
! operator.Source§impl Octal for AccessFlags
impl Octal for AccessFlags
Source§impl PartialEq for AccessFlags
impl PartialEq for AccessFlags
Source§impl Sub for AccessFlags
impl Sub for AccessFlags
Source§fn sub(self, other: AccessFlags) -> AccessFlags
fn sub(self, other: AccessFlags) -> AccessFlags
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 = AccessFlags
type Output = AccessFlags
- operator.Source§impl SubAssign for AccessFlags
impl SubAssign for AccessFlags
Source§fn sub_assign(&mut self, other: AccessFlags)
fn sub_assign(&mut self, other: AccessFlags)
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.