pub trait Encode {
// Required method
fn encode(&self) -> Result<Vec<u8>, EncodeError>;
// Provided method
fn into_encoded(self) -> Result<Vec<u8>, EncodeError>
where Self: Sized { ... }
}
Expand description
A trait that allows for encoding a structure into a byte sequence.