Skip to main content

Decode

Trait Decode 

Source
pub trait Decode {
    type Instruction: Debug;
    type Error: Debug + Error;

    // Required method
    fn decode(&mut self) -> Result<Self::Instruction, Self::Error>;

    // Provided method
    fn into_iter(self) -> Iter<Self> 
       where Self: Sized { ... }
}
Expand description

A instruction decoder

Required Associated Types§

Source

type Instruction: Debug

The instruction produced by this decoder

Source

type Error: Debug + Error

Errors produced during decoding

Required Methods§

Source

fn decode(&mut self) -> Result<Self::Instruction, Self::Error>

Decode a instruction

Provided Methods§

Source

fn into_iter(self) -> Iter<Self>
where Self: Sized,

Turn this decoder into a Iterator yielding Instructions. Errors are discarded. Once it returns None, it will always return None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§