ciborium_io

Trait Write

Source
pub trait Write {
    type Error;

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

A trait indicating a type that can write bytes

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

Required Associated Types§

Source

type Error

The error type

Required Methods§

Source

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

Writes all bytes from data or fails

Source

fn flush(&mut self) -> Result<(), Self::Error>

Flushes all output

Implementations on Foreign Types§

Source§

impl Write for &mut [u8]

Source§

type Error = OutOfSpace

Source§

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

Source§

fn flush(&mut self) -> Result<(), Self::Error>

Source§

impl<W: Write + ?Sized> Write for &mut W

Source§

type Error = <W as Write>::Error

Source§

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

Source§

fn flush(&mut self) -> Result<(), Self::Error>

Implementors§