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
sourceimpl Clone for FastGasCounter
impl Clone for FastGasCounter
sourcefn clone(&self) -> FastGasCounter
fn clone(&self) -> FastGasCounter
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FastGasCounter
impl Debug for FastGasCounter
sourceimpl PartialEq<FastGasCounter> for FastGasCounter
impl PartialEq<FastGasCounter> for FastGasCounter
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &FastGasCounter) -> bool
fn ne(&self, other: &FastGasCounter) -> bool
This method tests for !=
.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more