pub trait ToBytes {
// Required methods
fn to_bytes(&self) -> Result<Vec<u8>>;
fn bytes_len(&self) -> Result<usize>;
fn write_to(&self, w: impl SerBuf) -> Result<()>;
}pub trait ToBytes {
// Required methods
fn to_bytes(&self) -> Result<Vec<u8>>;
fn bytes_len(&self) -> Result<usize>;
fn write_to(&self, w: impl SerBuf) -> Result<()>;
}