Trait ProtocolDecode

Source
pub trait ProtocolDecode<'de, Context = ()>: Sized {
    // Required method
    fn decode_with(buf: Bytes, context: Context) -> Result<Self, Error>;

    // Provided method
    fn decode(buf: Bytes) -> Result<Self, Error>
       where Self: ProtocolDecode<'de> { ... }
}

Required Methods§

Source

fn decode_with(buf: Bytes, context: Context) -> Result<Self, Error>

Provided Methods§

Source

fn decode(buf: Bytes) -> Result<Self, Error>
where Self: ProtocolDecode<'de>,

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 ProtocolDecode<'_> for ()

Implementors§