stak-device 0.12.13

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 writes a byte.
pub trait Write {
    /// An error.
    type Error: Error;

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

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

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