pub struct BitBuf<S> { /* private fields */ }Expand description
The main structure
Keeps track of the data storage and a cursor for automatic operations
Implementations§
Source§impl<S> BitBuf<S>
impl<S> BitBuf<S>
Sourcepub fn bytes_mut(&mut self) -> &mut [u8]where
S: StorageMut,
pub fn bytes_mut(&mut self) -> &mut [u8]where
S: StorageMut,
Get the underlying bytes from the storage
Sourcepub fn advance(&mut self, bits: usize) -> &mut Self
pub fn advance(&mut self, bits: usize) -> &mut Self
Advance the internal cursor for automatic operations
This does not enforce that the cursor stay within storage bounds
Sourcepub fn seek(&mut self, offset: usize) -> &mut Self
pub fn seek(&mut self, offset: usize) -> &mut Self
Set the internal cursor for automatic operations
This does not enforce that the cursor stay within storage bounds
Sourcepub fn is_aligned(&self) -> bool
pub fn is_aligned(&self) -> bool
Checks if the internal cursor for automatic operations is aligned on the start of a byte
This does not care whether the cursor is outside storage bounds
Source§impl<S: StorageMut> BitBuf<S>
impl<S: StorageMut> BitBuf<S>
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for BitBuf<S>where
S: Freeze,
impl<S> RefUnwindSafe for BitBuf<S>where
S: RefUnwindSafe,
impl<S> Send for BitBuf<S>where
S: Send,
impl<S> Sync for BitBuf<S>where
S: Sync,
impl<S> Unpin for BitBuf<S>where
S: Unpin,
impl<S> UnsafeUnpin for BitBuf<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for BitBuf<S>where
S: UnwindSafe,
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