Skip to main content

Read

Trait Read 

Source
pub trait Read {
    // Required method
    fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>;
}
Expand description

A source of bytes.

This is the abstraction Decoder and the deserialization functions read from. See the module docs for the provided implementations.

Required Methods§

Source

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads exactly buf.len() bytes into buf.

Reaching the end of input before buf is full is an error of kind ErrorKind::UnexpectedEof; the contents of buf are then unspecified.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: Read> Read for T

Available on crate feature std only.