Struct diem_sdk::move_types::gas_schedule::GasPrice
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<GasPrice<GasCarrier>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<GasPrice<GasCarrier>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl GasAlgebra<u64> for GasPrice<u64>
impl GasAlgebra<u64> for GasPrice<u64>
§fn map<F>(self, f: F) -> Selfwhere
F: Fn(GasCarrier) -> GasCarrier,
fn map<F>(self, f: F) -> Selfwhere F: Fn(GasCarrier) -> GasCarrier,
Map a function
f
of one argument over the underlying data.§fn map2<F>(self, other: impl GasAlgebra<GasCarrier>, f: F) -> Selfwhere
F: Fn(GasCarrier, GasCarrier) -> GasCarrier,
fn map2<F>(self, other: impl GasAlgebra<GasCarrier>, f: F) -> Selfwhere 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.§fn app<T, F>(&self, other: &impl GasAlgebra<GasCarrier>, f: F) -> Twhere
F: Fn(GasCarrier, GasCarrier) -> T,
fn app<T, F>(&self, other: &impl GasAlgebra<GasCarrier>, f: F) -> Twhere 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.§fn unitary_cast<T>(self) -> Twhere
T: GasAlgebra<GasCarrier>,
fn unitary_cast<T>(self) -> Twhere T: GasAlgebra<GasCarrier>,
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.
§fn add(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn add(self, right: impl GasAlgebra<GasCarrier>) -> Self
Add the two
GasAlgebra
s together.§fn sub(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn sub(self, right: impl GasAlgebra<GasCarrier>) -> Self
Subtract one
GasAlgebra
from the other.§fn mul(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn mul(self, right: impl GasAlgebra<GasCarrier>) -> Self
Multiply two
GasAlgebra
s together.§fn div(self, right: impl GasAlgebra<GasCarrier>) -> Self
fn div(self, right: impl GasAlgebra<GasCarrier>) -> Self
Divide one
GasAlgebra
by the other.§impl<GasCarrier> PartialEq<GasPrice<GasCarrier>> for GasPrice<GasCarrier>where
GasCarrier: PartialEq<GasCarrier>,
impl<GasCarrier> PartialEq<GasPrice<GasCarrier>> for GasPrice<GasCarrier>where GasCarrier: PartialEq<GasCarrier>,
§impl<GasCarrier> Serialize for GasPrice<GasCarrier>where
GasCarrier: Serialize,
impl<GasCarrier> Serialize for GasPrice<GasCarrier>where GasCarrier: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl<GasCarrier> Copy for GasPrice<GasCarrier>where GasCarrier: Copy,
impl<GasCarrier> Eq for GasPrice<GasCarrier>where GasCarrier: Eq,
impl<GasCarrier> StructuralEq for GasPrice<GasCarrier>
impl<GasCarrier> StructuralPartialEq for GasPrice<GasCarrier>
Auto Trait Implementations§
impl<GasCarrier> RefUnwindSafe for GasPrice<GasCarrier>where GasCarrier: RefUnwindSafe,
impl<GasCarrier> Send for GasPrice<GasCarrier>where GasCarrier: Send,
impl<GasCarrier> Sync for GasPrice<GasCarrier>where GasCarrier: Sync,
impl<GasCarrier> Unpin for GasPrice<GasCarrier>where GasCarrier: Unpin,
impl<GasCarrier> UnwindSafe for GasPrice<GasCarrier>where GasCarrier: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.