pub trait CharDevice: SharedDeviceOps {
// Required methods
fn read(&self, buf: &mut [u8]) -> Result<usize, DeviceError>;
fn write(&self, buf: &[u8]) -> Result<usize, DeviceError>;
// Provided methods
fn peek(&self, buf: &mut [u8]) -> Result<usize, DeviceError> { ... }
fn has_data(&self) -> bool { ... }
fn has_space(&self) -> bool { ... }
fn set_nonblocking(&self, nonblocking: bool) -> Result<(), DeviceError> { ... }
}