pub trait ToBytes {
fn to_bytes(&self) -> Result<Vec<u8>, Error>;
fn write_bytes(&self, dst: &mut [u8]) -> Result<usize, Error> { ... }
}
Expand description
Serialize a type into a sequence of bytes with unspecified endianness. The implementations for the built-in types are in big endian for this trait.