moq_transport::coding

Trait Encode

Source
pub trait Encode: Sized {
    // Required method
    fn encode<W: BufMut>(&self, w: &mut W) -> Result<(), EncodeError>;

    // Provided method
    fn encode_remaining<W: BufMut>(
        buf: &mut W,
        required: usize,
    ) -> Result<(), EncodeError> { ... }
}

Required Methods§

Provided Methods§

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 Encode for u8

Source§

fn encode<W: BufMut>(&self, w: &mut W) -> Result<(), EncodeError>

Encode a u8 to the given writer.

Source§

impl Encode for u64

Source§

fn encode<W: BufMut>(&self, w: &mut W) -> Result<(), EncodeError>

Encode a varint to the given writer.

Source§

impl Encode for usize

Source§

fn encode<W: BufMut>(&self, w: &mut W) -> Result<(), EncodeError>

Encode a varint to the given writer.

Source§

impl Encode for String

Implementors§