Skip to main content

Read

Trait Read 

Source
pub trait Read {
    type Error;

    // Required methods
    fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>;
    fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>;
}
Expand description

Emulates std::io::Read with a simplified interface for no_std environments.

Required Associated Types§

Required Methods§

Source

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

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

Source

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

Read the exact number of bytes required to fill buf.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T> Read for T
where T: Read,

Available on crate feature std only.