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
use Read;
use void::Void;

/// Reader that infinitely repeats single byte.
///
/// It will never fail and never return 0.
pub struct Repeat {
    byte: u8,
}

impl Read for Repeat {
    type ReadError = Void;
    
    fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::ReadError> {
        // TODO: use memset?
        let len = buf.len();
        for b in buf {
            *b = self.byte;
        }
        Ok(len)
    }
}