Skip to main content

InstructionPolicy

Trait InstructionPolicy 

Source
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§

Source

type Instruction

One decoded instruction.

Source

type InstructionId: Copy + Eq + Ord

Stable identity used by branches, coverage, and receipts.

Required Methods§

Source

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".

Implementors§