pub trait Bits: Sealed + Binary + BitAnd<Self, Output = Self> + BitAndAssign<Self> + BitOrAssign<Self> + Copy + Debug + Default + Display + Eq + From<u8> + LowerHex + Not<Output = Self> + Shl<u8, Output = Self> + ShlAssign<u8> + Shr<u8, Output = Self> + ShrAssign<u8> + Sized + UpperHex {
const BITS: u8;
const WIDTH: u8 = _;
const MASK: u8 = _;
const MAX_ELT: usize = _;
fn ones(&self) -> u32;
fn zeros(&self) -> u32;
fn set(&mut self, place: u8, value: bool) { ... }
fn get(&self, place: u8) -> bool { ... }
fn split(cursor: usize) -> (usize, u8) { ... }
fn join(elt: usize, bit: u8) -> usize { ... }
}
Expand description
A trait for types that can be used as direct storage of bits.
This trait must only be implemented on unsigned integer primitives.
The dependency on Sealed
, a crate-private trait, ensures that this trait
can only ever be implemented locally, and no downstream crates are able to
implement it on new types.