moq_transfork::coding

Trait Decode

Source
pub trait Decode: Sized {
    // Required method
    fn decode<B: Buf>(buf: &mut B) -> Result<Self, DecodeError>;

    // Provided methods
    fn decode_more<B: Buf>(
        buf: &mut B,
        remain: usize,
    ) -> Result<Self, DecodeError> { ... }
    fn decode_cap<B: Buf>(buf: &mut B, remain: usize) -> Result<(), DecodeError> { ... }
}

Required Methods§

Source

fn decode<B: Buf>(buf: &mut B) -> Result<Self, DecodeError>

Provided Methods§

Source

fn decode_more<B: Buf>(buf: &mut B, remain: usize) -> Result<Self, DecodeError>

Source

fn decode_cap<B: Buf>(buf: &mut B, remain: usize) -> Result<(), DecodeError>

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 Decode for i8

Source§

impl Decode for u8

Source§

impl Decode for u32

Source§

impl Decode for u64

Source§

impl Decode for usize

Source§

impl Decode for String

Source§

fn decode<R: Buf>(r: &mut R) -> Result<Self, DecodeError>

Decode a string with a varint length prefix.

Source§

impl Decode for Duration

Source§

fn decode<B: Buf>(buf: &mut B) -> Result<Self, DecodeError>

Source§

impl<T: Decode> Decode for Vec<T>

Source§

fn decode<B: Buf>(buf: &mut B) -> Result<Self, DecodeError>

Implementors§