Trait Decoder

Source
pub trait Decoder {
    type Message<'a>: Sized;
    type Error<'a>;

    // Required method
    fn decode<'a>(
        &self,
        input: &'a [u8],
    ) -> Result<(&'a [u8], Self::Message<'a>), Self::Error<'a>>;

    // Provided method
    fn decode_static<'a>(
        &self,
        input: &'a [u8],
    ) -> Result<(&'a [u8], Self::Message<'static>), Self::Error<'static>>
       where Self::Message<'a>: IntoBoundedStatic<Static = Self::Message<'static>>,
             Self::Error<'a>: IntoBoundedStatic<Static = Self::Error<'static>> { ... }
}
Expand description

Decoder.

Implemented for types that know how to decode a specific IMAP message. See implementors.

Required Associated Types§

Source

type Message<'a>: Sized

Source

type Error<'a>

Required Methods§

Source

fn decode<'a>( &self, input: &'a [u8], ) -> Result<(&'a [u8], Self::Message<'a>), Self::Error<'a>>

Provided Methods§

Source

fn decode_static<'a>( &self, input: &'a [u8], ) -> Result<(&'a [u8], Self::Message<'static>), Self::Error<'static>>
where Self::Message<'a>: IntoBoundedStatic<Static = Self::Message<'static>>, Self::Error<'a>: IntoBoundedStatic<Static = Self::Error<'static>>,

Available on crate feature bounded-static only.

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.

Implementors§