pub trait EmbeddableParam: Sized {
// Required methods
fn extract(value: u8) -> Result<Self, ParseError>;
fn embed(&self) -> u8;
// Provided methods
fn extract_from_opcode(
opcode: u8,
pos: OpcodePosition,
) -> Result<Self, ParseError> { ... }
fn embed_to_opcode(&self, opcode: u8, pos: OpcodePosition) -> u8 { ... }
}Expand description
A value that can be embedded in an opcode
Required Methods§
Sourcefn extract(value: u8) -> Result<Self, ParseError>
fn extract(value: u8) -> Result<Self, ParseError>
Extracts the value from a given opcode. The value should be aligned to a byte for this method
Provided Methods§
Sourcefn extract_from_opcode(
opcode: u8,
pos: OpcodePosition,
) -> Result<Self, ParseError>
fn extract_from_opcode( opcode: u8, pos: OpcodePosition, ) -> Result<Self, ParseError>
Extracts a value from the given opcode.
Sourcefn embed_to_opcode(&self, opcode: u8, pos: OpcodePosition) -> u8
fn embed_to_opcode(&self, opcode: u8, pos: OpcodePosition) -> u8
Embeds a value in the given opcode
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.