Trait BitSet

Source
pub trait BitSet:
    Copy
    + BitOr<Output = Self>
    + BitOrAssign
    + BitAnd<Output = Self>
    + BitAndAssign
    + Not {
    // Required method
    fn nonzero(&self) -> bool;

    // Provided method
    fn contains(&self, other: &Self) -> bool { ... }
}
Available on crate feature compiler only.
Expand description

Utility trait used to improve ergonomics of flag composition.

Required Methods§

Source

fn nonzero(&self) -> bool

Whether the underlying integer storing this bitset is not equal to 0.

This must be implemented by each struct because the definition of “zero” depends on the width of the integer type used to store the bitset.

Provided Methods§

Source

fn contains(&self, other: &Self) -> bool

Whether the other flag was provided to the current bitset.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BitSet for ChimeraFlags

Available on crate feature chimera only.
Source§

impl BitSet for ChimeraMode

Available on crate feature chimera only.
Source§

impl BitSet for CpuFeatures

Source§

impl BitSet for Flags

Source§

impl BitSet for Mode