pub struct BlockGroupFlags(/* private fields */);Expand description
Block group / chunk type flags: the combination of chunk type (DATA, SYSTEM, METADATA) and RAID profile stored in on-disk chunk items and block group items.
Display produces the dump-tree format: DATA|DUP, METADATA|single, etc.
Implementations§
Source§impl BlockGroupFlags
impl BlockGroupFlags
pub const DATA: BlockGroupFlags
pub const SYSTEM: BlockGroupFlags
pub const METADATA: BlockGroupFlags
pub const RAID0: BlockGroupFlags
pub const RAID1: BlockGroupFlags
pub const DUP: BlockGroupFlags
pub const RAID10: BlockGroupFlags
pub const RAID5: BlockGroupFlags
pub const RAID6: BlockGroupFlags
pub const RAID1C3: BlockGroupFlags
pub const RAID1C4: BlockGroupFlags
Sourcepub const SINGLE: BlockGroupFlags
pub const SINGLE: BlockGroupFlags
Explicit “single” marker (bit 48). When no profile bits are set, the allocation is also single.
Sourcepub const GLOBAL_RSV: BlockGroupFlags
pub const GLOBAL_RSV: BlockGroupFlags
Pseudo-type used for the global reservation pool.
Source§impl BlockGroupFlags
impl BlockGroupFlags
Sourcepub const fn empty() -> BlockGroupFlags
pub const fn empty() -> BlockGroupFlags
Get a flags value with all bits unset.
Sourcepub const fn all() -> BlockGroupFlags
pub const fn all() -> BlockGroupFlags
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u64) -> Option<BlockGroupFlags>
pub const fn from_bits(bits: u64) -> Option<BlockGroupFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u64) -> BlockGroupFlags
pub const fn from_bits_truncate(bits: u64) -> BlockGroupFlags
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u64) -> BlockGroupFlags
pub const fn from_bits_retain(bits: u64) -> BlockGroupFlags
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<BlockGroupFlags>
pub fn from_name(name: &str) -> Option<BlockGroupFlags>
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: BlockGroupFlags) -> bool
pub const fn intersects(&self, other: BlockGroupFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: BlockGroupFlags) -> bool
pub const fn contains(&self, other: BlockGroupFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: BlockGroupFlags)
pub fn insert(&mut self, other: BlockGroupFlags)
The bitwise or (|) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: BlockGroupFlags)
pub fn remove(&mut self, other: BlockGroupFlags)
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: BlockGroupFlags)
pub fn toggle(&mut self, other: BlockGroupFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: BlockGroupFlags, value: bool)
pub fn set(&mut self, other: BlockGroupFlags, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: BlockGroupFlags) -> BlockGroupFlags
pub const fn intersection(self, other: BlockGroupFlags) -> BlockGroupFlags
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: BlockGroupFlags) -> BlockGroupFlags
pub const fn union(self, other: BlockGroupFlags) -> BlockGroupFlags
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: BlockGroupFlags) -> BlockGroupFlags
pub const fn difference(self, other: BlockGroupFlags) -> BlockGroupFlags
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: BlockGroupFlags,
) -> BlockGroupFlags
pub const fn symmetric_difference( self, other: BlockGroupFlags, ) -> BlockGroupFlags
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> BlockGroupFlags
pub const fn complement(self) -> BlockGroupFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl BlockGroupFlags
impl BlockGroupFlags
Sourcepub const fn iter(&self) -> Iter<BlockGroupFlags>
pub const fn iter(&self) -> Iter<BlockGroupFlags>
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<BlockGroupFlags>
pub const fn iter_names(&self) -> IterNames<BlockGroupFlags>
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 BlockGroupFlags
impl Binary for BlockGroupFlags
Source§impl BitAnd for BlockGroupFlags
impl BitAnd for BlockGroupFlags
Source§fn bitand(self, other: BlockGroupFlags) -> BlockGroupFlags
fn bitand(self, other: BlockGroupFlags) -> BlockGroupFlags
The bitwise and (&) of the bits in two flags values.
Source§type Output = BlockGroupFlags
type Output = BlockGroupFlags
& operator.Source§impl BitAndAssign for BlockGroupFlags
impl BitAndAssign for BlockGroupFlags
Source§fn bitand_assign(&mut self, other: BlockGroupFlags)
fn bitand_assign(&mut self, other: BlockGroupFlags)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for BlockGroupFlags
impl BitOr for BlockGroupFlags
Source§fn bitor(self, other: BlockGroupFlags) -> BlockGroupFlags
fn bitor(self, other: BlockGroupFlags) -> BlockGroupFlags
The bitwise or (|) of the bits in two flags values.
Source§type Output = BlockGroupFlags
type Output = BlockGroupFlags
| operator.Source§impl BitOrAssign for BlockGroupFlags
impl BitOrAssign for BlockGroupFlags
Source§fn bitor_assign(&mut self, other: BlockGroupFlags)
fn bitor_assign(&mut self, other: BlockGroupFlags)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for BlockGroupFlags
impl BitXor for BlockGroupFlags
Source§fn bitxor(self, other: BlockGroupFlags) -> BlockGroupFlags
fn bitxor(self, other: BlockGroupFlags) -> BlockGroupFlags
The bitwise exclusive-or (^) of the bits in two flags values.
Source§type Output = BlockGroupFlags
type Output = BlockGroupFlags
^ operator.Source§impl BitXorAssign for BlockGroupFlags
impl BitXorAssign for BlockGroupFlags
Source§fn bitxor_assign(&mut self, other: BlockGroupFlags)
fn bitxor_assign(&mut self, other: BlockGroupFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for BlockGroupFlags
impl Clone for BlockGroupFlags
Source§fn clone(&self) -> BlockGroupFlags
fn clone(&self) -> BlockGroupFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BlockGroupFlags
Source§impl Debug for BlockGroupFlags
impl Debug for BlockGroupFlags
impl Eq for BlockGroupFlags
Source§impl Extend<BlockGroupFlags> for BlockGroupFlags
impl Extend<BlockGroupFlags> for BlockGroupFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = BlockGroupFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = BlockGroupFlags>,
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 BlockGroupFlags
impl Flags for BlockGroupFlags
Source§const FLAGS: &'static [Flag<BlockGroupFlags>]
const FLAGS: &'static [Flag<BlockGroupFlags>]
Source§fn from_bits_retain(bits: u64) -> BlockGroupFlags
fn from_bits_retain(bits: u64) -> BlockGroupFlags
Source§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
Source§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
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<BlockGroupFlags> for BlockGroupFlags
impl FromIterator<BlockGroupFlags> for BlockGroupFlags
Source§fn from_iter<T>(iterator: T) -> BlockGroupFlagswhere
T: IntoIterator<Item = BlockGroupFlags>,
fn from_iter<T>(iterator: T) -> BlockGroupFlagswhere
T: IntoIterator<Item = BlockGroupFlags>,
The bitwise or (|) of the bits in each flags value.
Source§impl Hash for BlockGroupFlags
impl Hash for BlockGroupFlags
Source§impl IntoIterator for BlockGroupFlags
impl IntoIterator for BlockGroupFlags
Source§type Item = BlockGroupFlags
type Item = BlockGroupFlags
Source§type IntoIter = Iter<BlockGroupFlags>
type IntoIter = Iter<BlockGroupFlags>
Source§fn into_iter(self) -> <BlockGroupFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <BlockGroupFlags as IntoIterator>::IntoIter
Source§impl LowerHex for BlockGroupFlags
impl LowerHex for BlockGroupFlags
Source§impl Not for BlockGroupFlags
impl Not for BlockGroupFlags
Source§fn not(self) -> BlockGroupFlags
fn not(self) -> BlockGroupFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§type Output = BlockGroupFlags
type Output = BlockGroupFlags
! operator.Source§impl Octal for BlockGroupFlags
impl Octal for BlockGroupFlags
Source§impl PartialEq for BlockGroupFlags
impl PartialEq for BlockGroupFlags
impl StructuralPartialEq for BlockGroupFlags
Source§impl Sub for BlockGroupFlags
impl Sub for BlockGroupFlags
Source§fn sub(self, other: BlockGroupFlags) -> BlockGroupFlags
fn sub(self, other: BlockGroupFlags) -> BlockGroupFlags
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 = BlockGroupFlags
type Output = BlockGroupFlags
- operator.Source§impl SubAssign for BlockGroupFlags
impl SubAssign for BlockGroupFlags
Source§fn sub_assign(&mut self, other: BlockGroupFlags)
fn sub_assign(&mut self, other: BlockGroupFlags)
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.