Skip to main content

Read

Trait Read 

Source
pub trait Read {
    type Error;

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

Read bytes.

When the std feature is enabled (by default), this trait is automatically implemented for any type that implemented std::io::Read.

Required Associated Types§

Required Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Read for &[u8]

Source§

type Error = Infallible

Source§

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

Implementors§