#[repr(transparent)]
pub struct BitFlags<T: RawBitFlags> { /* fields omitted */ }
Expand description
Represents a set of flags of some type T
.
The type must have the #[derive(BitFlags)]
attribute applied.
Create a new BitFlags unsafely, without checking if the bits form
a valid bit pattern for the type.
Consider using from_bits
or from_bits_truncate
instead.
The argument must not have set bits at positions not corresponding to
any flag.
Create an empty BitFlags. Empty means 0
.
Create a BitFlags with all flags set.
Returns true if all flags are set
Returns true if no flag is set
Returns the underlying type value
Returns true if at least one flag is shared.
Returns true if all flags are contained.
Returns a BitFlags<T>
if the raw value provided does not contain
any illegal flags.
Turn a T
into a BitFlags<T>
. Also available as flag.into()
.
Truncates flags that are illegal
Toggles the matching bits
Inserts the flags into the BitFlag
Removes the matching flags
Returns an iterator that yields each set flag
Formats the value using the given formatter.
The resulting type after applying the &
operator.
The resulting type after applying the |
operator.
The resulting type after applying the ^
operator.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
The default value returned is one with all flags unset, i. e. empty
.
Returns the “default value” for a type. Read more
Extends a collection with the contents of an iterator. Read more
🔬 This is a nightly-only experimental API. (extend_one
)
Extends a collection with exactly one element.
🔬 This is a nightly-only experimental API. (extend_one
)
Reserves capacity in a collection for the given number of additional elements. Read more
Formats the value using the given formatter.
The resulting type after applying the !
operator.
Formats the value using the given formatter.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
Formats the value using the given formatter.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.