pub struct BitsMut<'s> {
pub storage: BitPieceStorageMutRef<'s>,
pub start_bit_index: usize,
}Expand description
a convenience type for interacting with the bits of an underlying storage type, starting at a specific bit index. this is useful for implementing mutable references to bitpieces.
Fields§
§storage: BitPieceStorageMutRef<'s>§start_bit_index: usizeImplementations§
Source§impl<'s> BitsMut<'s>
impl<'s> BitsMut<'s>
pub const fn new( storage: BitPieceStorageMutRef<'s>, start_bit_index: usize, ) -> Self
Sourcepub const fn get_bits(&self, rel_bit_index: usize, len: usize) -> u64
pub const fn get_bits(&self, rel_bit_index: usize, len: usize) -> u64
returns len bits starting at relative bit index rel_bit_index.
Sourcepub const fn get_bits_noshift(&self, rel_bit_index: usize, len: usize) -> u64
pub const fn get_bits_noshift(&self, rel_bit_index: usize, len: usize) -> u64
returns len bits starting at relative bit index rel_bit_index, but returns them at their original bit position.
basically, this only masks the value, without shifting.
Trait Implementations§
Auto Trait Implementations§
impl<'s> Freeze for BitsMut<'s>
impl<'s> RefUnwindSafe for BitsMut<'s>
impl<'s> Send for BitsMut<'s>
impl<'s> Sync for BitsMut<'s>
impl<'s> Unpin for BitsMut<'s>
impl<'s> !UnwindSafe for BitsMut<'s>
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