pub type UartIoResult<T, E> = core::result::Result<T, UartIoError<E>>;
pub type UartResult<T, E> = core::result::Result<T, UartError<E>>;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum UartError<E> {
Io(UartIoError<E>),
Protocol(msrt::error::Error),
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum UartIoError<E> {
WouldBlock,
Interrupted,
Other(E),
}
pub trait UartIo {
type Error;
fn read(&mut self, buf: &mut [u8]) -> UartIoResult<usize, Self::Error>;
fn write_all(&mut self, bytes: &[u8]) -> UartIoResult<(), Self::Error>;
}