Trait ebml_iterable::tools::Vint

source ·
pub trait Vint: Into<u64> + Copy {
    fn as_vint(&self) -> Result<Vec<u8>, ToolError> { ... }
    fn as_vint_with_length(&self, length: usize) -> Result<Vec<u8>, ToolError> { ... }
}
Expand description

Trait to enable easy serialization to a vint.

This is only available for types that can be cast as u64.

Provided Methods§

Returns a representation of the current value as a vint array.

Errors

This can return an error if the value is too large to be representable as a vint.

Returns a representation of the current value as a vint array with a specified length.

Errors

This can return an error if the value is too large to be representable as a vint.

Implementations on Foreign Types§

Implementors§