Skip to main content

Encode

Trait Encode 

Source
pub trait Encode: Encoded {
    // Required methods
    fn encoded_len(&self) -> usize;
    fn try_write<W: Sink>(self, out: &mut W) -> Result<(), W::Error>;
}
Expand description

A generated field value with an exact encoded length.

Required Methods§

Source

fn encoded_len(&self) -> usize

Source

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

Stops at the first rejected fragment and preserves its exact error.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Encode for Encoder<'_>

Source§

impl<T: Bytes> Encode for Value<T>