pub trait SerWrite {
type Error;
// Required method
fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>;
// Provided methods
fn write_byte(&mut self, byte: u8) -> Result<(), Self::Error> { ... }
fn write_str(&mut self, s: &str) -> Result<(), Self::Error> { ... }
}Expand description
Serializers should write data to the implementations of this trait.