[][src]Struct cosmwasm_vm::GasInfo

pub struct GasInfo {
    pub cost: u64,
    pub externally_used: u64,
}

Fields

cost: u64

The gas cost of a computation that was executed already but not yet charged

externally_used: u64

Gas that was used and charged externally. This is needed to adjust the VM's gas limit but does not affect the gas usage.

Implementations

impl GasInfo[src]

pub fn with_cost(amount: u64) -> Self[src]

pub fn with_externally_used(amount: u64) -> Self[src]

pub fn free() -> Self[src]

Creates a gas information with no cost for the caller and with zero externally used gas.

Caution: when using this you need to make sure no gas was metered externally to keep the gas values in sync.

Trait Implementations

impl AddAssign<GasInfo> for GasInfo[src]

impl Clone for GasInfo[src]

impl Copy for GasInfo[src]

impl Debug for GasInfo[src]

Auto Trait Implementations

impl RefUnwindSafe for GasInfo

impl Send for GasInfo

impl Sync for GasInfo

impl Unpin for GasInfo

impl UnwindSafe for GasInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.