pub trait Teletype {
// Required methods
fn write(&mut self, data: &[u8]) -> Result<usize, KernelError>;
fn read(&mut self, data: &mut [u8]) -> Result<usize, KernelError>;
}Expand description
The Teletype trait represents a generic character-based input/output
device.
Implementations of this trait define methods for:
- Writing data to the teletype (
write) - Reading data from the teletype (
read)
This abstraction allows for different kinds of terminal or serial interfaces to implement their own communication methods.