Skip to main content

BitRead

Trait BitRead 

Source
pub trait BitRead: Read {
    // Required method
    fn read_bits<O: BitStore>(
        &mut self,
        dest: &mut BitSlice<O>,
    ) -> Result<usize>;

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

The BitRead trait allows for reading bits from a source.

Required Methods§

Source

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

Pull some bits from this source into the specified buffer, returning how many bits were read.

Provided Methods§

Source

fn read_bits_exact<O: BitStore>(&mut self, dest: &mut BitSlice<O>) -> Result<()>

Read the exact number of bits required to fill buf.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§