pub trait Canon: Sized + Clone {
    fn encode(&self, sink: &mut Sink<'_>);
fn decode(source: &mut Source<'_>) -> Result<Self, CanonError>;
fn encoded_len(&self) -> usize; }
Expand description

Trait to read/write values as bytes

Required methods

Write the encoded value as bytes to a Sink

Return the decoded value from bytes in a Source

Returns the number of bytes needed to encode this value

Implementations on Foreign Types

Implementors