pub trait Decoder {
type Item;
type Error: Error + 'static;
// Required method
fn decode(
&mut self,
src: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>;
// Provided method
fn decode_eof(
&mut self,
src: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error> { ... }
}