pub trait Encode { type Err; fn write_to<W: Write>(&self, writer: &mut W) -> Result<(), Self::Err>; }