Trait embedded_io::ErrorType
source · pub trait ErrorType {
type Error: Error;
}
Expand description
Base trait for all IO traits, defining the error type.
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
Error
associated type 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
and <T as Write>::Error
which might be different types.
Required Associated Types§
Implementations on Foreign Types§
source§impl ErrorType for Vec<u8>
Available on crate features std
or alloc
only.
impl ErrorType for Vec<u8>
Available on crate features
std
or alloc
only.type Error = Infallible
source§impl<T: ?Sized + ErrorType> ErrorType for Box<T>
Available on crate features std
or alloc
only.
impl<T: ?Sized + ErrorType> ErrorType for Box<T>
Available on crate features
std
or alloc
only.