moq_transport::coding

Trait Decode

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

    // Provided method
    fn decode_remaining<B: Buf>(
        buf: &mut B,
        required: usize,
    ) -> Result<(), DecodeError> { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn decode_remaining<B: Buf>( buf: &mut B, required: 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 u8

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.

Implementors§