#[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
Implementations§
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 Display for FastGasCounter
impl Display for FastGasCounter
Source§impl PartialEq for FastGasCounter
impl PartialEq for FastGasCounter
impl Eq for FastGasCounter
impl StructuralPartialEq for FastGasCounter
Auto Trait Implementations§
impl Freeze for FastGasCounter
impl RefUnwindSafe for FastGasCounter
impl Send for FastGasCounter
impl Sync for FastGasCounter
impl Unpin for FastGasCounter
impl UnwindSafe for FastGasCounter
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.