1
0
Fork 0
forked from AbleOS/ableos
ableOS_v1Change/ableos/src/driver_traits/character_device.rs

11 lines
435 B
Rust

pub trait CharacterDevice {
/// Returns true if the device can be read from.
fn can_read(&self) -> bool;
/// Returns true if the device can be written to
fn can_write(&self) -> bool;
/// Reads a single character from the device
fn read_char(&mut self) -> Option<char>;
/// Writes a single character to the device and returns true if the write was successful
fn write_char(&mut self, c: char) -> bool;
}