pub trait Serialize { fn to_writer<W: Write>(&self, _: &mut W) -> Result<()>; fn to_bytes(&self) -> Result<Vec<u8>> { ... } }