pub struct GasStatus<'a> { /* private fields */ }
Expand description

The Move VM implementation of state for gas metering.

Initialize with a CostTable and the gas provided to the transaction. Provide all the proper guarantees about gas metering in the Move VM.

Every client must use an instance of this type to interact with the Move VM.

Implementations

Initialize the gas state with metering enabled.

Charge for every operation and fail when there is no more gas to pay for operations. This is the instantiation that must be used when executing a user script.

Initialize the gas state with metering disabled.

It should be used by clients in very specific cases and when executing system code that does not have to charge the user.

Return the CostTable behind this GasStatus.

Return the gas left.

Charge a given amount of gas and fail if not enough gas units are left.

Trait Implementations

Charge an instruction and fail if not enough gas units are left.

Charge for executing a native function. The cost is calculated returned by the native function implementation. Should fail if not enough gas units are left. Read more

Charges for loading a resource from storage. This is only called when the resource is not cached. Read more

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.