protozer0

Trait Varint

Source
pub trait Varint: Sized {
    const MAX_LEN: usize = _;

    // Required methods
    fn from_varint(buf: &mut &[u8]) -> Result<Self>;
    fn to_varint(self, buf: &mut [u8]) -> u8;
    fn append_varint(self, buf: &mut Vec<u8>);
}

Provided Associated Constants§

Source

const MAX_LEN: usize = _

Required Methods§

Source

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source

fn to_varint(self, buf: &mut [u8]) -> u8

Source

fn append_varint(self, buf: &mut Vec<u8>)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Varint for i8

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for i16

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for i32

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for i64

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for u8

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for u16

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for u32

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Source§

impl Varint for u64

Source§

fn from_varint(buf: &mut &[u8]) -> Result<Self>

Source§

fn to_varint(self, buf: &mut [u8]) -> u8

Source§

fn append_varint(self, buf: &mut Vec<u8>)

Implementors§