Trait ByteDecoder

Source
pub trait ByteDecoder<'a> {
    type InitError: IntoDeError + Debug;
    type DecodeError: IntoDeError + Debug;
    type Decoder: Iterator<Item = Result<u8, Self::DecodeError>>;

    // Required method
    fn from_str(s: &'a str) -> Result<Self::Decoder, Self::InitError>;
}
Expand description

Provides an instance of string-to-byte decoder.

This is basically a type constructor used in places where value arguments are not accepted. Such as the generic serialize.

Required Associated Types§

Source

type InitError: IntoDeError + Debug

Error returned when decoder can’t be created.

This is typically returned when string length is invalid.

Source

type DecodeError: IntoDeError + Debug

Error returned when decoding fails.

This is typically returned when the input string contains malformed chars.

Source

type Decoder: Iterator<Item = Result<u8, Self::DecodeError>>

The decoder state.

Required Methods§

Source

fn from_str(s: &'a str) -> Result<Self::Decoder, Self::InitError>

Constructs the decoder from string.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§