Trait embedded_io::Io

source ·
pub trait Io {
    type Error: Error;
}
Expand description

Base trait for all IO traits.

All IO operations of all traits return the error defined in this trait.

Having a shared trait instead of having every trait define its own io::Error enforces all impls on the same type use the same error. This is very convenient when writing generic code, it means you have to handle a single error type T::Error, instead of <T as Read>::Error, <T as Write>::Error which might be different types.

Required Associated Types§

source

type Error: Error

Error type of all the IO operations on this type.

Implementations on Foreign Types§

source§

impl Io for &[u8]

source§

impl Io for &mut [u8]

source§

impl Io for Vec<u8>

Available on crate features std or alloc only.
source§

impl<T: ?Sized + Io> Io for &mut T

§

type Error = <T as Io>::Error

source§

impl<T: ?Sized + Io> Io for Box<T>

Available on crate features std or alloc only.
§

type Error = <T as Io>::Error

Implementors§