[][src]Struct lrl_test_compiler::bits::BitWriter

pub struct BitWriter {
    data: Vec<u8>,
    cursor: usize,
}

BitWriter is a data structure for appending bit sized data to a sequence of bytes

Fields

data: Vec<u8>

The data in the BitWriter

cursor: usize

The current position in the BitWriter

Implementations

impl BitWriter[src]

pub fn new() -> Self[src]

Create a new empty BitWriter

pub fn append<D>(&mut self, data: D) where
    D: BitSource
[src]

Append the whole bit source to this BitWriter

pub fn append_tail<D>(&mut self, data: D, len: u8) where
    D: BitSource
[src]

Append the tail (least significant bits) of a bit source to this BitWriter

pub fn append_range<D>(&mut self, data: D, offset: u8, len: u8) where
    D: BitSource
[src]

Appends the bits that make up the selected range of the data to the bit buffer.

fn room(&self) -> u8[src]

How much room is left in the current cell

fn update(&mut self, overlay: u8, append: Vec<u8>, increment: u8)[src]

Applies the overlay to the current cell, adds new cells and increments the cursor

pub fn as_bytes(&self) -> &[u8][src]

Read this BitWriter's byte contents

pub fn len(&self) -> usize[src]

See how many bits have been appended

Trait Implementations

impl Clone for BitWriter[src]

impl Debug for BitWriter[src]

impl Eq for BitWriter[src]

impl From<BitWriter> for BitReader[src]

impl PartialEq<BitWriter> for BitWriter[src]

impl StructuralEq for BitWriter[src]

impl StructuralPartialEq for BitWriter[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]