Trait ntex::codec::Decoder [−][src]
pub trait Decoder { type Item; type Error: Debug; fn decode(
&self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>; fn decode_eof(
&self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error> { ... } }
Expand description
Decoding of frames via buffers.
Associated Types
Required methods
Provided methods
fn decode_eof(
&self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
[src]
fn decode_eof(
&self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
[src]A default method available to be called when there are no more bytes available to be read from the underlying I/O.
This method defaults to calling decode
and returns an error if
Ok(None)
is returned while there is unconsumed data in buf
.
Typically this doesn’t need to be implemented unless the framing
protocol differs near the end of the stream.
Implementations on Foreign Types
impl<T> Decoder for Rc<T> where
T: Decoder,
[src]
impl<T> Decoder for Rc<T> where
T: Decoder,
[src]type Item = <T as Decoder>::Item
type Error = <T as Decoder>::Error
pub fn decode(
&self,
src: &mut BytesMut
) -> Result<Option<<Rc<T> as Decoder>::Item>, <Rc<T> as Decoder>::Error>
[src]
&self,
src: &mut BytesMut
) -> Result<Option<<Rc<T> as Decoder>::Item>, <Rc<T> as Decoder>::Error>
pub fn decode_eof(
&self,
src: &mut BytesMut
) -> Result<Option<<Rc<T> as Decoder>::Item>, <Rc<T> as Decoder>::Error>
[src]
&self,
src: &mut BytesMut
) -> Result<Option<<Rc<T> as Decoder>::Item>, <Rc<T> as Decoder>::Error>
Implementors
impl Decoder for ClientCodec
[src]
impl Decoder for ClientCodec
[src]impl Decoder for ClientPayloadCodec
[src]
impl Decoder for ClientPayloadCodec
[src]impl Decoder for PayloadDecoder
[src]
impl Decoder for PayloadDecoder
[src]