Struct q_compress::BitWriter
source · [−]pub struct BitWriter { /* private fields */ }
Expand description
BitWriter
builds a Vec<usize>
, enabling a compressor to write bit-level
information and ultimately output a Vec<u8>
.
It does this by maintaining a bit index from 0-usize::BITS within its most recent byte.
The reader is consider is considered “aligned” if the current bit index is 0 or usize::BITS (i.e. at the start or end of the current byte).
Implementations
sourceimpl BitWriter
impl BitWriter
sourcepub fn write_aligned_bytes(&mut self, bytes: &[u8]) -> QCompressResult<()>
pub fn write_aligned_bytes(&mut self, bytes: &[u8]) -> QCompressResult<()>
Appends the bits to the writer. Will return an error if the writer is misaligned.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BitWriter
impl Send for BitWriter
impl Sync for BitWriter
impl Unpin for BitWriter
impl UnwindSafe for BitWriter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more