Skip to main content

Encode

Trait Encode 

Source
pub trait Encode: Sized {
    const MAX_LEN: usize = usize::MAX;

    // Required method
    fn encode<W>(self, out: &mut W) -> Result<(), Error>
       where W: Sink<Error = Error>;
}
Expand description

Consumes one body into the admitted output without repeating its size check.

Provided Associated Constants§

Source

const MAX_LEN: usize = usize::MAX

Upper bound for the admitted encoding limit, or usize::MAX when unknown.

Required Methods§

Source

fn encode<W>(self, out: &mut W) -> Result<(), Error>
where W: Sink<Error = Error>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Encode for Infallible

Source§

fn encode<W: Sink<Error = Error>>(self, _: &mut W) -> Result<(), Error>

Implementors§