[][src]Struct bitwise::BitWriter

pub struct BitWriter<W: Write> {
    pub pad_zero: bool,
    // some fields omitted
}

Writer to bitwise writing to Write

Fields

pad_zero: bool

Implementations

impl<W: Write> BitWriter<W>[src]

pub fn new(inner: W, pad_zero: bool) -> Self[src]

Create a new BitWriter from a Write Trait with default capacity of 1024 Bytes

pub fn with_capacity(capacity: usize, inner: W, pad_zero: bool) -> Self[src]

Create a new BitWriter with a capacity (in Bytes)

pub fn write(&mut self, bit: Bit) -> Result<()>[src]

Writes a single Bit into the internal Buffer If internal buffer is full -> Call internal write

pub fn write_bits(&mut self, bits: &Vec<Bit>) -> Result<()>[src]

Writes a vector of Bits into the internal Buffer If internal buffer is full -> Call internal write

pub fn write_buf(&mut self) -> Result<()>[src]

Write the internal Buffer and Pad with Zero? If needed

pub fn discard_non_byte(&mut self)[src]

Removes excess bits that do not form a byte

pub fn is_empty(&self) -> bool[src]

Returns true if the Buffer is empty

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

Returns the length of the internal buffer

Trait Implementations

impl<W: Debug + Write> Debug for BitWriter<W>[src]

impl<W: Write> Drop for BitWriter<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for BitWriter<W> where
    W: RefUnwindSafe
[src]

impl<W> Send for BitWriter<W> where
    W: Send
[src]

impl<W> Sync for BitWriter<W> where
    W: Sync
[src]

impl<W> Unpin for BitWriter<W> where
    W: Unpin
[src]

impl<W> UnwindSafe for BitWriter<W> where
    W: UnwindSafe
[src]

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<T> From<T> for T[src]

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

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.