pub trait BitFlags: ImplementedByBitFlagsMacro {
    type Bits: Bits;
    type Iter: Iterator<Item = Self>;
    type IterNames: Iterator<Item = (&'static str, Self)>;

Show 17 methods fn empty() -> Self; fn all() -> Self; fn bits(&self) -> Self::Bits; fn from_bits(bits: Self::Bits) -> Option<Self>
    where
        Self: Sized
; fn from_bits_truncate(bits: Self::Bits) -> Self; fn from_bits_retain(bits: Self::Bits) -> Self; fn from_name(name: &str) -> Option<Self>
    where
        Self: Sized
; fn iter(&self) -> Self::Iter; fn iter_names(&self) -> Self::IterNames; fn is_empty(&self) -> bool; fn is_all(&self) -> bool; fn intersects(&self, other: Self) -> bool; fn contains(&self, other: Self) -> bool; fn insert(&mut self, other: Self); fn remove(&mut self, other: Self); fn toggle(&mut self, other: Self); fn set(&mut self, other: Self, value: bool);
}
Expand description

A trait that is automatically implemented for all bitflags.

It should not be implemented manually.

Required Associated Types

The underlying integer type.

An iterator over enabled flags in an instance of the type.

An iterator over the raw names and bits for enabled flags in an instance of the type.

Required Methods

Returns an empty set of flags.

Returns the set containing all flags.

Returns the raw value of the flags currently stored.

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

Get the flag for a particular name.

Iterate over enabled flag values.

Iterate over the raw names and bits for enabled flag values.

Returns true if no flags are currently stored.

Returns true if all flags are currently set.

Returns true if there are flags common to both self and other.

Returns true all of the flags in other are contained within self.

Inserts the specified flags in-place.

Removes the specified flags in-place.

Toggles the specified flags in-place.

Inserts or removes the specified flags depending on the passed value.

Implementors