1 2 3 4 5 6 7 8 9
use core::fmt::Debug; pub trait Device { type Error: Debug; fn read(&mut self) -> Result<Option<u8>, Self::Error>; fn write(&mut self, byte: u8) -> Result<(), Self::Error>; fn write_error(&mut self, byte: u8) -> Result<(), Self::Error>; }