Trait imap_codec::decode::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§
Required Methods§
fn decode<'a>( &self, input: &'a [u8] ) -> Result<(&'a [u8], Self::Message<'a>), Self::Error<'a>>
Provided Methods§
sourcefn 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>>,
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.