Struct diem_sdk::move_types::gas_schedule::InternalGasUnits
pub struct InternalGasUnits<GasCarrier>(_);
Expand description
Units of gas used within the Move VM, scaled for fine-grained accounting.
Trait Implementations§
§impl<GasCarrier> Clone for InternalGasUnits<GasCarrier>where
GasCarrier: Clone,
impl<GasCarrier> Clone for InternalGasUnits<GasCarrier>where GasCarrier: Clone,
§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 more§impl<GasCarrier> Debug for InternalGasUnits<GasCarrier>where
GasCarrier: Debug,
impl<GasCarrier> Debug for InternalGasUnits<GasCarrier>where GasCarrier: Debug,
§impl<'de, GasCarrier> Deserialize<'de> for InternalGasUnits<GasCarrier>where
GasCarrier: Deserialize<'de>,
impl<'de, GasCarrier> Deserialize<'de> for InternalGasUnits<GasCarrier>where GasCarrier: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<InternalGasUnits<GasCarrier>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<InternalGasUnits<GasCarrier>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl GasAlgebra<u64> for InternalGasUnits<u64>
impl GasAlgebra<u64> for InternalGasUnits<u64>
§fn new(c: u64) -> InternalGasUnits<u64>
fn new(c: u64) -> InternalGasUnits<u64>
Project a value into the gas algebra.
§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> Hash for InternalGasUnits<GasCarrier>where
GasCarrier: Hash,
impl<GasCarrier> Hash for InternalGasUnits<GasCarrier>where GasCarrier: Hash,
§impl<GasCarrier> PartialEq<InternalGasUnits<GasCarrier>> for InternalGasUnits<GasCarrier>where
GasCarrier: PartialEq<GasCarrier>,
impl<GasCarrier> PartialEq<InternalGasUnits<GasCarrier>> for InternalGasUnits<GasCarrier>where GasCarrier: PartialEq<GasCarrier>,
§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 ==
.§impl<GasCarrier> Serialize for InternalGasUnits<GasCarrier>where
GasCarrier: Serialize,
impl<GasCarrier> Serialize for InternalGasUnits<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 InternalGasUnits<GasCarrier>where GasCarrier: Copy,
impl<GasCarrier> Eq for InternalGasUnits<GasCarrier>where GasCarrier: Eq,
impl<GasCarrier> StructuralEq for InternalGasUnits<GasCarrier>
impl<GasCarrier> StructuralPartialEq for InternalGasUnits<GasCarrier>
Auto Trait Implementations§
impl<GasCarrier> RefUnwindSafe for InternalGasUnits<GasCarrier>where GasCarrier: RefUnwindSafe,
impl<GasCarrier> Send for InternalGasUnits<GasCarrier>where GasCarrier: Send,
impl<GasCarrier> Sync for InternalGasUnits<GasCarrier>where GasCarrier: Sync,
impl<GasCarrier> Unpin for InternalGasUnits<GasCarrier>where GasCarrier: Unpin,
impl<GasCarrier> UnwindSafe for InternalGasUnits<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.