pub struct Injector {
    pub global_name: &'static str,
}
Expand description

Injects a mutable global variable and a local function to the module to track current gas left.

The function is called in every metering block. In case of falling out of gas, the global is set to the sentinel value U64::MAX and unreachable instruction is called. The execution engine should take care of getting the current global value and setting it back in order to sync the gas left value during an execution.

Fields§

§global_name: &'static str

The export name of the gas tracking global.

Implementations§

Trait Implementations§

Provides the gas metering implementation details.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.