2022-11-07 19:29:42 +00:00
|
|
|
use crate::device_interface::CharacterDevice;
|
2022-02-09 13:08:40 +00:00
|
|
|
|
2022-02-12 09:25:02 +00:00
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
2022-02-09 13:08:40 +00:00
|
|
|
pub struct DevNull;
|
|
|
|
impl CharacterDevice for DevNull {
|
|
|
|
fn can_read(&self) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
fn can_write(&self) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
fn read_char(&mut self) -> Option<char> {
|
|
|
|
Some(0x00 as char)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn write_char(&mut self, _: char) -> bool {
|
|
|
|
true
|
|
|
|
}
|
2022-03-02 14:38:22 +00:00
|
|
|
|
|
|
|
fn reset(&mut self) {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn initialize(&mut self) -> bool {
|
|
|
|
todo!()
|
|
|
|
}
|
2022-02-09 13:08:40 +00:00
|
|
|
}
|