genio 0.2.1

A type safe, low level replacement for `std::io`. Supports `no_std` for embedded development, just disable cargo feature `std`. Because of limitations of `std::io::Error` type, `genio` provides `Read` and `Write` traits that allow implementors to choose their own type. This type can be better at expressing what kinds of error can happen.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Read;
use void::Void;

/// This reader is empty - always returns 0 from read method.
pub struct Empty;

impl Read for Empty {
    type ReadError = Void;
    
    fn read(&mut self, _buf: &mut [u8]) -> Result<usize, Self::ReadError> {
        Ok(0)
    }
}