little-kitty 0.0.3

A low-level interface for the Kitty Graphics Protocol
Documentation
use std::io::*;

//
// ReadByte
//

/// Read a single byte.
pub trait ReadByte
where
    Self: Sized,
{
    /// Read a single byte.
    fn read_byte(&mut self) -> Result<u8>;
}

impl<ReadT> ReadByte for ReadT
where
    ReadT: Read,
{
    fn read_byte(&mut self) -> Result<u8> {
        let mut buffer = [0; 1];
        self.read_exact(&mut buffer)?;
        Ok(buffer[0])
    }
}