Trait BitRead

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

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

The BitRead trait allows for reading bits from a source.

Required Methods§

Source

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

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

Provided Methods§

Source

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

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BitRead for &BitSlice<u8, Msb0>

Source§

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

Implementors§

Source§

impl<T> BitRead for BitCursor<T>
where T: BorrowBits,