pub struct GasMeter { /* private fields */ }
Expand description

Struct to keep track of gas usage

Implementations

Default percentage of gas to be given to a GasMeter when limited is called.

Creates a new GasMeter with given gas limits

Deduct specified amount of gas from the meter

Mutates the left gas amount

Returns how much gas left from the initial budget.

Returns the gas limit.

Returns how much gas was actually spent.

Create a new limited GasMeter. If limit parameter is 0, default limit is assumed that satisfies the requirement for obligatory gas reserve (Self::RESERVE_PERCENTAGE of the gas left). The limit provided cannot exceed the gas left, if that happens the total amount of gas is used as limit.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Return a reference to the key of the leaf type

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more