forked from AbleOS/ableos
11 lines
435 B
Rust
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;
|
||
|
}
|