Struct evm_gasometer::Gasometer[][src]

pub struct Gasometer<'config> { /* fields omitted */ }

EVM gasometer.

Implementations

impl<'config> Gasometer<'config>[src]

pub fn new(gas_limit: u64, config: &'config Config) -> Self[src]

Create a new gasometer with given gas limit and config.

pub fn config(&self) -> &'config Config[src]

Reference of the config.

pub fn gas(&self) -> u64[src]

Remaining gas.

pub fn total_used_gas(&self) -> u64[src]

Total used gas.

pub fn refunded_gas(&self) -> i64[src]

Refunded gas.

pub fn fail(&mut self) -> ExitError[src]

Explictly fail the gasometer with out of gas. Return OutOfGas error.

pub fn record_cost(&mut self, cost: u64) -> Result<(), ExitError>[src]

Record an explict cost.

pub fn record_refund(&mut self, refund: i64) -> Result<(), ExitError>[src]

Record an explict refund.

pub fn record_deposit(&mut self, len: usize) -> Result<(), ExitError>[src]

Record CREATE code deposit.

pub fn record_dynamic_cost(
    &mut self,
    cost: GasCost,
    memory: Option<MemoryCost>
) -> Result<(), ExitError>
[src]

Record opcode gas cost.

pub fn record_stipend(&mut self, stipend: u64) -> Result<(), ExitError>[src]

Record opcode stipend.

pub fn record_transaction(
    &mut self,
    cost: TransactionCost
) -> Result<(), ExitError>
[src]

Record transaction cost.

Trait Implementations

impl<'config> Clone for Gasometer<'config>[src]

Auto Trait Implementations

impl<'config> RefUnwindSafe for Gasometer<'config>

impl<'config> Send for Gasometer<'config>

impl<'config> Sync for Gasometer<'config>

impl<'config> Unpin for Gasometer<'config>

impl<'config> UnwindSafe for Gasometer<'config>

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[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]