Trait Decoder

Source
pub trait Decoder<'a>: Sized {
    // Required methods
    fn decode<T: DecoderValue<'a> + DecoderValueMut<'a>>(
        self,
    ) -> Result<(T, Self), DecoderError>;
    fn decode_slice(self, len: usize) -> Result<(Self, Self), DecoderError>;
}
Expand description

A generic interface over a decoder buffer

Required Methods§

Source

fn decode<T: DecoderValue<'a> + DecoderValueMut<'a>>( self, ) -> Result<(T, Self), DecoderError>

Source

fn decode_slice(self, len: usize) -> Result<(Self, Self), DecoderError>

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<'a> Decoder<'a> for DecoderBuffer<'a>

Source§

fn decode<T: DecoderValue<'a> + DecoderValueMut<'a>>( self, ) -> Result<(T, Self), DecoderError>

Source§

fn decode_slice(self, len: usize) -> Result<(Self, Self), DecoderError>

Implementors§

Source§

impl<'a> Decoder<'a> for s2n_quic_core::packet::interceptor::DecoderBufferMut<'a>

Source§

impl<'a> Decoder<'a> for s2n_quic_core::xdp::bpf::DecoderBufferMut<'a>