ciborium_io

Trait Read

Source
pub trait Read {
    type Error;

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

A trait indicating a type that can read bytes

Note that this is similar to std::io::Read, but simplified for use in a no_std context.

Required Associated Types§

Source

type Error

The error type

Required Methods§

Source

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

Reads exactly data.len() bytes or fails

Implementations on Foreign Types§

Source§

impl Read for &[u8]

Source§

type Error = EndOfFile

Source§

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

Source§

impl<R: Read + ?Sized> Read for &mut R

Source§

type Error = <R as Read>::Error

Source§

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

Implementors§