Trait bytesutil::ReadExt

source ·
pub trait ReadExt: Sized {
    // Required methods
    fn read_le<T: ReadFrom>(&mut self) -> Result<T>;
    fn read_be<T: ReadFrom>(&mut self) -> Result<T>;
}
Available on crate feature std only.
Expand description

Endian aware read from a Read.

Required Methods§

source

fn read_le<T: ReadFrom>(&mut self) -> Result<T>

Reads bytes from self and return an instance of val in little endian order.

Errors

Returns an Error if some bytes could not be read.

source

fn read_be<T: ReadFrom>(&mut self) -> Result<T>

Reads bytes from self and return an instance of val in big endian order.

Errors

Returns an Error if some bytes could not be read.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<R: Read> ReadExt for R