stak_device/device/
void.rs1use crate::{BufferError, Device};
2use winter_maybe_async::maybe_async;
3
4#[derive(Debug, Default)]
6pub struct VoidDevice {}
7
8impl VoidDevice {
9 pub fn new() -> Self {
11 Self::default()
12 }
13}
14
15impl Device for VoidDevice {
16 type Error = BufferError;
17
18 #[maybe_async]
19 fn read(&mut self) -> Result<Option<u8>, Self::Error> {
20 Ok(None)
21 }
22
23 #[maybe_async]
24 fn write(&mut self, _byte: u8) -> Result<(), Self::Error> {
25 Ok(())
26 }
27
28 #[maybe_async]
29 fn write_error(&mut self, _byte: u8) -> Result<(), Self::Error> {
30 Ok(())
31 }
32}