Trait tsz::stream::Read

source ·
pub trait Read {
    // Required methods
    fn read_bit(&mut self) -> Result<Bit, Error>;
    fn read_byte(&mut self) -> Result<u8, Error>;
    fn read_bits(&mut self, num: u32) -> Result<u64, Error>;
    fn peak_bits(&mut self, num: u32) -> Result<u64, Error>;
}
Expand description

Read

Read is a trait that encapsulates the functionality required to read from a stream of bytes.

Required Methods§

source

fn read_bit(&mut self) -> Result<Bit, Error>

Read a single bit from the underlying stream.

source

fn read_byte(&mut self) -> Result<u8, Error>

Read a single byte from the underlying stream.

source

fn read_bits(&mut self, num: u32) -> Result<u64, Error>

Read num bits from the underlying stream.

source

fn peak_bits(&mut self, num: u32) -> Result<u64, Error>

Get the next num bits, but do not update place in stream.

Implementors§