Trait streamdata::Decoder
source · pub trait Decoder<Input>where
Input: Buffer,{
type Value;
type Error;
// Required method
fn decode(
&mut self,
input: &mut Input
) -> Result<Self::Value, DecodeError<Self::Error>>;
}Expand description
Decoder represents the ability to decode a value from a given buffer
of data.
Required Associated Types§
Required Methods§
sourcefn decode(
&mut self,
input: &mut Input
) -> Result<Self::Value, DecodeError<Self::Error>>
fn decode( &mut self, input: &mut Input ) -> Result<Self::Value, DecodeError<Self::Error>>
Decode (up to one) value from the buffer, returning the decoded value
accompanied by the amount of bytes consumed from the buf on success,
or a relevant decoding error.