Struct near_vm_logic::gas_counter::FastGasCounter
source · #[repr(C)]pub struct FastGasCounter {
pub burnt_gas: u64,
pub gas_limit: u64,
pub opcode_cost: u64,
}
Expand description
Fast gas counter with very simple structure, could be exposed to compiled code in the VM.
Fields§
§burnt_gas: u64
The following three fields must be put next to another to make sure generated gas counting code can use and adjust them. We will share counter to ensure we never miss synchronization. This could change and in such a case synchronization required between compiled WASM code and the host code. The amount of gas that was irreversibly used for contract execution.
gas_limit: u64
Hard gas limit for execution
opcode_cost: u64
Single WASM opcode cost
Trait Implementations§
source§impl Clone for FastGasCounter
impl Clone for FastGasCounter
source§fn clone(&self) -> FastGasCounter
fn clone(&self) -> FastGasCounter
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 Debug for FastGasCounter
impl Debug for FastGasCounter
source§impl PartialEq<FastGasCounter> for FastGasCounter
impl PartialEq<FastGasCounter> for FastGasCounter
source§fn eq(&self, other: &FastGasCounter) -> bool
fn eq(&self, other: &FastGasCounter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FastGasCounter
impl StructuralEq for FastGasCounter
impl StructuralPartialEq for FastGasCounter
Auto Trait Implementations§
impl RefUnwindSafe for FastGasCounter
impl Send for FastGasCounter
impl Sync for FastGasCounter
impl Unpin for FastGasCounter
impl UnwindSafe for FastGasCounter
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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request