mod buffer_error;
mod fixed_buffer;
#[cfg(feature = "libc")]
pub mod libc;
#[cfg(feature = "std")]
mod read_write;
#[cfg(feature = "std")]
mod stdio;
pub use buffer_error::BufferError;
use core::error::Error;
pub use fixed_buffer::FixedBufferDevice;
#[cfg(feature = "std")]
pub use read_write::ReadWriteDevice;
#[cfg(feature = "std")]
pub use stdio::StdioDevice;
pub trait Device {
type Error: Error;
fn read(&mut self) -> Result<Option<u8>, Self::Error>;
fn write(&mut self, byte: u8) -> Result<(), Self::Error>;
fn write_error(&mut self, byte: u8) -> Result<(), Self::Error>;
}