Struct fuel_vm::gas::DependentCost

source ·
pub struct DependentCost {
    pub base: Word,
    pub dep_per_unit: Word,
}
Expand description

Dependent cost is a cost that depends on the number of units. The cost starts at the base and grows by dep_per_unit for every unit.

For example, if the base is 10 and the dep_per_unit is 2, then the cost for 0 units is 10, 1 unit is 12, 2 units is 14, etc.

Fields§

§base: Word

The minimum that this operation can cost.

§dep_per_unit: Word

The amount that this operation costs per increase in unit.

Implementations§

Create costs that are all set to zero.

Create costs that are all set to one.

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
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Returns a reference to the underlying type as Any.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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