Struct q_compress::BitWriter
source · [−]pub struct BitWriter { /* private fields */ }
Expand description
Builds compressed data, enabling a Compressor
to
write bit-level information and ultimately output a Vec<u8>
.
It does this by maintaining a bit index from 0 to usize::BITS
within its
most recent usize
.
The writer is consider is considered “aligned” if the current bit index
is byte-aligned; e.g. bit_idx % 8 == 0
.
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 · sourcefn borrow_mut(&mut self) -> &mut T
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.
sourcefn clone_into(&self, target: &mut T)
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