Trait VarInt

Source
pub trait VarInt: Sized + Copy {
    // Required methods
    fn write<W>(&self, w: &mut W)
       where W: Write;
    fn read<R>(r: &mut R) -> Result<Self, Error>
       where R: Read;
}

Required Methods§

Source

fn write<W>(&self, w: &mut W)
where W: Write,

Source

fn read<R>(r: &mut R) -> Result<Self, Error>
where R: Read,

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 write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<i8, Error>
where R: Read,

Source§

impl VarInt for i16

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<i16, Error>
where R: Read,

Source§

impl VarInt for i32

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<i32, Error>
where R: Read,

Source§

impl VarInt for i64

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<i64, Error>
where R: Read,

Source§

impl VarInt for isize

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<isize, Error>
where R: Read,

Source§

impl VarInt for u8

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<u8, Error>
where R: Read,

Source§

impl VarInt for u16

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<u16, Error>
where R: Read,

Source§

impl VarInt for u32

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<u32, Error>
where R: Read,

Source§

impl VarInt for u64

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<u64, Error>
where R: Read,

Source§

impl VarInt for u128

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<u128, Error>
where R: Read,

Source§

impl VarInt for usize

Source§

fn write<W>(&self, w: &mut W)
where W: Write,

Source§

fn read<R>(r: &mut R) -> Result<usize, Error>
where R: Read,

Implementors§