Struct move_core_types::gas_schedule::InternalGasUnits
source · pub struct InternalGasUnits<GasCarrier>(_);
Expand description
Units of gas used within the Move VM, scaled for fine-grained accounting.
Trait Implementations§
source§impl<GasCarrier: Clone> Clone for InternalGasUnits<GasCarrier>
impl<GasCarrier: Clone> Clone for InternalGasUnits<GasCarrier>
source§fn clone(&self) -> InternalGasUnits<GasCarrier>
fn clone(&self) -> InternalGasUnits<GasCarrier>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<GasCarrier: Debug> Debug for InternalGasUnits<GasCarrier>
impl<GasCarrier: Debug> Debug for InternalGasUnits<GasCarrier>
source§impl<'de, GasCarrier> Deserialize<'de> for InternalGasUnits<GasCarrier>where
GasCarrier: Deserialize<'de>,
impl<'de, GasCarrier> Deserialize<'de> for InternalGasUnits<GasCarrier>where GasCarrier: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl GasAlgebra<u64> for InternalGasUnits<GasCarrier>
impl GasAlgebra<u64> for InternalGasUnits<GasCarrier>
source§fn new(c: GasCarrier) -> Self
fn new(c: GasCarrier) -> Self
Project a value into the gas algebra.
source§fn get(&self) -> GasCarrier
fn get(&self) -> GasCarrier
Get the carrier.
source§fn map<F: Fn(GasCarrier) -> GasCarrier>(self, f: F) -> Self
fn map<F: Fn(GasCarrier) -> GasCarrier>(self, f: F) -> Self
Map a function
f
of one argument over the underlying data.source§fn map2<F: Fn(GasCarrier, GasCarrier) -> GasCarrier>(
self,
other: impl GasAlgebra<GasCarrier>,
f: F
) -> Self
fn map2<F: Fn(GasCarrier, GasCarrier) -> GasCarrier>( self, other: impl GasAlgebra<GasCarrier>, f: F ) -> Self
Map a function
f
of two arguments over the underlying carrier. Note that this function
can take two different implementations of the trait – one for self
the other for the
second argument. But, we enforce that they have the same underlying carrier.source§fn app<T, F: Fn(GasCarrier, GasCarrier) -> T>(
&self,
other: &impl GasAlgebra<GasCarrier>,
f: F
) -> T
fn app<T, F: Fn(GasCarrier, GasCarrier) -> T>( &self, other: &impl GasAlgebra<GasCarrier>, f: F ) -> T
Apply a function
f
of two arguments to the carrier. Since f
is not an endomorphism, we
return the resulting value, as opposed to the result wrapped up in ourselves.source§fn unitary_cast<T: GasAlgebra<GasCarrier>>(self) -> T
fn unitary_cast<T: GasAlgebra<GasCarrier>>(self) -> T
We allow casting between GasAlgebras as long as they have the same underlying carrier –
i.e. they use the same type to store the underlying value.
source§fn add(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn add(self, right: impl GasAlgebra<GasCarrier>) -> Self
Add the two
GasAlgebra
s together.source§fn sub(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn sub(self, right: impl GasAlgebra<GasCarrier>) -> Self
Subtract one
GasAlgebra
from the other.source§fn mul(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn mul(self, right: impl GasAlgebra<GasCarrier>) -> Self
Multiply two
GasAlgebra
s together.source§fn div(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn div(self, right: impl GasAlgebra<GasCarrier>) -> Self
Divide one
GasAlgebra
by the other.source§impl<GasCarrier: Hash> Hash for InternalGasUnits<GasCarrier>
impl<GasCarrier: Hash> Hash for InternalGasUnits<GasCarrier>
source§impl<GasCarrier: PartialEq> PartialEq<InternalGasUnits<GasCarrier>> for InternalGasUnits<GasCarrier>
impl<GasCarrier: PartialEq> PartialEq<InternalGasUnits<GasCarrier>> for InternalGasUnits<GasCarrier>
source§fn eq(&self, other: &InternalGasUnits<GasCarrier>) -> bool
fn eq(&self, other: &InternalGasUnits<GasCarrier>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.