Trait ordered_varint::Variable
source · [−]pub trait Variable: Sized {
fn encode_variable<W: Write>(&self, destination: &mut 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.
fn decode_variable<R: Read>(source: R) -> Result<Self>
fn decode_variable<R: Read>(source: R) -> Result<Self>
Decodes a variable length value from source.
Provided methods
fn to_variable_vec(&self) -> Result<Vec<u8>>
fn to_variable_vec(&self) -> Result<Vec<u8>>
Encodes self into a new Vec<u8>.