pub trait InstructionPolicy {
type Instruction;
type InstructionId: Copy + Eq + Ord;
// Required method
fn instruction_id(instruction: &Self::Instruction) -> Self::InstructionId;
}Expand description
Supplies stable instruction identity and the consumer’s decoded form.
For example, a WebAssembly decoder or a BEAM loader can supply this policy.
Required Associated Types§
Sourcetype Instruction
type Instruction
One decoded instruction.
Sourcetype InstructionId: Copy + Eq + Ord
type InstructionId: Copy + Eq + Ord
Stable identity used by branches, coverage, and receipts.
Required Methods§
Sourcefn instruction_id(instruction: &Self::Instruction) -> Self::InstructionId
fn instruction_id(instruction: &Self::Instruction) -> Self::InstructionId
Returns the stable identity of instruction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".