stak-device 0.12.17

Devices for Stak Scheme
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::error::Error;

/// A trait that reads a byte.
pub trait Read {
    /// An error.
    type Error: Error;

    /// Reads a byte.
    fn read(&mut self) -> Result<Option<u8>, Self::Error>;
}

impl<T: Read> Read for &mut T {
    type Error = T::Error;

    fn read(&mut self) -> Result<Option<u8>, Self::Error> {
        (**self).read()
    }
}