Trait BitWrite

Source
pub trait BitWrite: Write {
    // Required method
    fn write_bits<O>(
        &mut self,
        source: &BitSlice<O, Msb0>,
    ) -> Result<usize, Error>
       where O: BitStore;

    // Provided method
    fn write_all_bits<O>(
        &mut self,
        source: &BitSlice<O, Msb0>,
    ) -> Result<(), Error>
       where O: BitStore { ... }
}
Expand description

A trait for objects which are bit-oriented sinks.

Required Methods§

Source

fn write_bits<O>(&mut self, source: &BitSlice<O, Msb0>) -> Result<usize, Error>
where O: BitStore,

Write a buffer into this writer, returning how many bytes were written.

Provided Methods§

Source

fn write_all_bits<O>(&mut self, source: &BitSlice<O, Msb0>) -> Result<(), Error>
where O: BitStore,

Write the entirety buf into self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<S> BitWrite for &mut BitSlice<S, Msb0>
where S: BitStore,

Source§

fn write_bits<O>(&mut self, source: &BitSlice<O, Msb0>) -> Result<usize, Error>
where O: BitStore,

Implementors§