pub trait Encodable {
type Error;
// Required methods
fn encoded_len(&self) -> usize;
fn encode(&self, buf: &mut [u8]) -> Result<(), Self::Error>;
}
Expand description
An encodable type can write itself into a byte buffer.
Required Associated Types§
Required Methods§
Sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the number of bytes necessary to encode |self|.