pub struct Bits32 { /* private fields */ }
Expand description
32bits container where you can push and pop multiple bits as a integer.
See the crate level documentaion for more details.
Implementations§
Source§impl Bits32
impl Bits32
Sourcepub fn get(&self) -> u32
pub fn get(&self) -> u32
Copy out the current bit pattern of this container.
§Example
let mut bits = Bits32::new(0);
bits.push(5, 0b10110_u16);
bits.push_bool(true);
assert_eq!(0b10110_1, bits.get());
Sourcepub fn push_bool(&mut self, value: bool)
pub fn push_bool(&mut self, value: bool)
Push a boolean as a single bit.
§Examples
let mut bits = Bits32::new(0);
bits.push_bool(true);
bits.push_bool(false);
assert_eq!(0b10, bits.get());
Trait Implementations§
Source§impl Ord for Bits32
impl Ord for Bits32
Source§impl PartialOrd for Bits32
impl PartialOrd for Bits32
impl Eq for Bits32
impl StructuralPartialEq for Bits32
Auto Trait Implementations§
impl Freeze for Bits32
impl RefUnwindSafe for Bits32
impl Send for Bits32
impl Sync for Bits32
impl Unpin for Bits32
impl UnwindSafe for Bits32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more