Skip to main content

VmDiagnostics

Trait VmDiagnostics 

Source
pub trait VmDiagnostics {
    // Required method
    fn function_used(
        &mut self,
        context: &RuntimeContext,
        hash: Hash,
        at: usize,
    ) -> Result<(), VmError>;
}
Expand description

A trait for runtime diagnostics in the virtual machine.

Required Methods§

Source

fn function_used( &mut self, context: &RuntimeContext, hash: Hash, at: usize, ) -> Result<(), VmError>

Mark that a function has been used.

This is called for every native function which is being called, so any filtering of interesting hashes has to be performed here. The context in which the function was called is provided for that purpose, see for example RuntimeContext::deprecation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§