Skip to main content

InstructionMetadata

Trait InstructionMetadata 

Source
pub trait InstructionMetadata {
    // Required methods
    fn label_arg(&self) -> Option<Arg<Label>>;
    fn is_scope_exit(&self) -> bool;
    fn is_unconditional_jump(&self) -> bool;
    fn stack_effect_info(&self, oparg: u32) -> StackEffect;
    fn fmt_dis(
        &self,
        arg: OpArg,
        f: &mut Formatter<'_>,
        ctx: &impl InstrDisplayContext,
        expand_code_objects: bool,
        pad: usize,
        level: usize,
    ) -> Result<(), Error>;

    // Provided methods
    fn stack_effect(&self, oparg: u32) -> i32 { ... }
    fn display(
        &self,
        arg: OpArg,
        ctx: &impl InstrDisplayContext,
    ) -> impl Display { ... }
}

Required Methods§

Source

fn label_arg(&self) -> Option<Arg<Label>>

Gets the label stored inside this instruction, if it exists.

Source

fn is_scope_exit(&self) -> bool

Source

fn is_unconditional_jump(&self) -> bool

Source

fn stack_effect_info(&self, oparg: u32) -> StackEffect

Stack effect info for how many items are pushed/popped from the stack, for this instruction.

Source

fn fmt_dis( &self, arg: OpArg, f: &mut Formatter<'_>, ctx: &impl InstrDisplayContext, expand_code_objects: bool, pad: usize, level: usize, ) -> Result<(), Error>

Provided Methods§

Source

fn stack_effect(&self, oparg: u32) -> i32

Stack effect of Self::stack_effect_info.

Source

fn display(&self, arg: OpArg, ctx: &impl InstrDisplayContext) -> impl Display

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§