pub trait Variable: Sized {
    fn encode_variable<W: Write>(&self, destination: W) -> Result<usize>;
    fn decode_variable<R: Read>(source: R) -> Result<Self>;

    fn to_variable_vec(&self) -> Result<Vec<u8>> { ... }
}
Expand description

Encodes and decodes a type using a variable-length format.

Required Methods§

Encodes self into destination, returning the number of bytes written upon success.

Decodes a variable length value from source.

Provided Methods§

Encodes self into a new Vec<u8>.

Implementations on Foreign Types§

Implementors§