Struct diem_sdk::move_types::gas_schedule::GasUnits [−][src]
pub struct GasUnits<GasCarrier>(_);
Expand description
Units of gas as seen by clients of the Move VM.
Trait Implementations
impl<'de, GasCarrier> Deserialize<'de> for GasUnits<GasCarrier> where
GasCarrier: Deserialize<'de>,
impl<'de, GasCarrier> Deserialize<'de> for GasUnits<GasCarrier> where
GasCarrier: Deserialize<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<GasUnits<GasCarrier>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<GasUnits<GasCarrier>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Map a function f
of one argument over the underlying data.
fn map2<F>(self, other: impl GasAlgebra<GasCarrier>, f: F) -> Self where
F: Fn(GasCarrier, GasCarrier) -> GasCarrier,
fn map2<F>(self, other: impl GasAlgebra<GasCarrier>, f: F) -> Self where
F: Fn(GasCarrier, GasCarrier) -> GasCarrier,
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>(&self, other: &impl GasAlgebra<GasCarrier>, f: F) -> T where
F: Fn(GasCarrier, GasCarrier) -> T,
fn app<T, F>(&self, other: &impl GasAlgebra<GasCarrier>, f: F) -> T where
F: Fn(GasCarrier, GasCarrier) -> 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.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<GasCarrier> RefUnwindSafe for GasUnits<GasCarrier> where
GasCarrier: RefUnwindSafe,
impl<GasCarrier> UnwindSafe for GasUnits<GasCarrier> where
GasCarrier: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generates a hash used only for tests.
pub fn vzip(self) -> V
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