little-kitty 0.0.3

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

//
// WriteChar
//

/// Write a single char.
pub trait WriteChar {
    /// Write a single char.
    fn write_char(&mut self, c: char) -> Result<()>;
}

impl<WriteT> WriteChar for WriteT
where
    WriteT: Write,
{
    fn write_char(&mut self, char_: char) -> Result<()> {
        let mut buffer = [0; 4];
        let string = char_.encode_utf8(&mut buffer);
        self.write_all(string.as_bytes())
    }
}