Skip to main content

MeteredMachine

Trait MeteredMachine 

Source
pub trait MeteredMachine: Machine {
    // Required methods
    fn add_gas(&mut self, amount: u32);
    fn run(&mut self, max_gas: u32) -> Result<RunResult>;
}
Expand description

Machines whose execution is resource-bounded and resumable — the shape of nanobots’ StateMachine (gas checked per basic block, explicit yields) and of wasmtime’s fuel. No provider in this crate implements it yet; the trait is here so the downstream shape and the machine family agree.

Required Methods§

Source

fn add_gas(&mut self, amount: u32)

Source

fn run(&mut self, max_gas: u32) -> Result<RunResult>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§