Codable

Trait Codable 

Source
pub trait Codable: Sized {
    // Required methods
    fn encode(&self) -> u16;
    fn decode(value: u16, mode: Mode) -> Option<Self>;
}
Expand description

Trait which allows for the encoding and decoding of instructions and portions thereof. This trait can only be implemented if it is impossible for the encoding of the implementing type to fail.

Required Methods§

Source

fn encode(&self) -> u16

Encodes the instruction or portion thereof.

Source

fn decode(value: u16, mode: Mode) -> Option<Self>

Decodes the instruction given the current mode of execution.

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§