pub trait Decode<Decoded> {
type Error: Error;
// Required method
fn decode_bytes(
self,
input_bytes: &[u8],
encoding: RepresentationIdentifier
) -> Result<Decoded, Self::Error>;
}
Expand description
The trait Decode
defines a decoder object that produced a value of type
Dec
from a slice of bytes and a RepresentationIdentifier
. Note
that Decoded
maps to associated type Decoded
in
DeserializerAdapter
, not D
.
Required Associated Types§
sourcetype Error: Error
type Error: Error
The decoding error type returned by Self::decode_bytes
.
Required Methods§
sourcefn decode_bytes(
self,
input_bytes: &[u8],
encoding: RepresentationIdentifier
) -> Result<Decoded, Self::Error>
fn decode_bytes( self, input_bytes: &[u8], encoding: RepresentationIdentifier ) -> Result<Decoded, Self::Error>
Tries to decode the given byte slice to a value of type D
using the
given encoding.
Implementors§
source§impl<'de, D, S, SK> Decode<D> for CdrDeserializeSeedDecoder<S, SK>where
S: DeserializeSeed<'de, Value = D>,
impl<'de, D, S, SK> Decode<D> for CdrDeserializeSeedDecoder<S, SK>where
S: DeserializeSeed<'de, Value = D>,
Decode type based on a serde::de::DeserializeSeed
-based decoder.