Trait ReadSimple

Source
pub trait ReadSimple {
    type Error: Debug;

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

A simple read trait suitable for embedded devices.

Required Associated Types§

Source

type Error: Debug

The error type used by this reader.

Required Methods§

Source

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

Read up to buf.len() bytes into the given buffer, returning the exact number of bytes read.

The caller makes no guarantees about the contents of buf.

In the case of an error, the contents of buf are undefined.

Implementors§

Source§

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