ReadExt

Trait ReadExt 

Source
pub trait ReadExt {
    // Required methods
    fn read_u16<B: ByteOrder>(&mut self, byte_order: B) -> Result<u16, Error>;
    fn read_u32<B: ByteOrder>(&mut self, byte_order: B) -> Result<u32, Error>;
    fn read_bytes<const SIZE: usize>(&mut self) -> Result<[u8; SIZE], Error>;
}

Required Methods§

Source

fn read_u16<B: ByteOrder>(&mut self, byte_order: B) -> Result<u16, Error>

Reads a u16 from the reader

Source

fn read_u32<B: ByteOrder>(&mut self, byte_order: B) -> Result<u32, Error>

Reads a u32 from the reader

Source

fn read_bytes<const SIZE: usize>(&mut self) -> Result<[u8; SIZE], Error>

Has nothing to do with byte order, just reads a fixed number of bytes

But exists for simplicity

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.

Implementors§

Source§

impl<R: Read> ReadExt for R