Skip to main content

BitWrite

Trait BitWrite 

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

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

A trait for objects which are bit-oriented sinks.

Required Methods§

Source

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

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

Provided Methods§

Source

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

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".

Implementors§

Source§

impl<S: BitStore> BitWrite for &mut BitSlice<S>

Source§

impl<T> BitWrite for BitCursor<T>