Struct move_core_types::gas_schedule::GasPrice [−][src]
pub struct GasPrice<GasCarrier>(_);
Expand description
A newtype wrapper around the gas price for each unit of gas consumed.
Trait Implementations
impl<'de, GasCarrier> Deserialize<'de> for GasPrice<GasCarrier> where
GasCarrier: Deserialize<'de>,
impl<'de, GasCarrier> Deserialize<'de> for GasPrice<GasCarrier> where
GasCarrier: Deserialize<'de>,
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
Project a value into the gas algebra.
Get the carrier.
Map a function f
of one argument over the underlying data.
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. Read more
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. Read more
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. Read more
Add the two GasAlgebra
s together.
Subtract one GasAlgebra
from the other.
Multiply two GasAlgebra
s together.
Divide one GasAlgebra
by the other.
Auto Trait Implementations
impl<GasCarrier> RefUnwindSafe for GasPrice<GasCarrier> where
GasCarrier: RefUnwindSafe,
impl<GasCarrier> UnwindSafe for GasPrice<GasCarrier> where
GasCarrier: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more