Trait bit_manager::BitWrite [] [src]

pub trait BitWrite: Sized {
    fn write_bit(&mut self, bit: bool) -> Result<()>;

    fn write_byte(&mut self, byte: u8) -> Result<()> { ... }
fn write<T: BitStore>(&mut self, value: &T) -> Result<()> { ... }
fn write_using<T, C>(&mut self, value: &T, converter: &C) -> Result<()>
    where
        C: BitConvert<T>
, { ... }
fn write_buffer<T, B>(&mut self, buffer: B) -> usize
    where
        T: BitStore,
        B: AsRef<[T]>
, { ... }
fn write_buffer_using<T, B, C>(&mut self, buffer: B, converter: &C) -> usize
    where
        B: AsRef<[T]>,
        C: BitConvert<T>
, { ... } }

A trait for types that can write bits

Required Methods

Writes a single bit.

Provided Methods

Writes a single byte.

Default implementation is unoptimized and should be overridden

Writes a value that implements BitStore using the write_to function.

Writes a value using a converter that implements BitConvert with the write_value_to function.

Writes values that implement BitStore from a buffer. Returns the number of values written.

Writes values using a converter that implements BitConvert from a buffer. Returns the number of values written.

Implementors