Struct evm_gasometer::Gasometer [−][src]
pub struct Gasometer<'config> { /* fields omitted */ }
Expand description
EVM gasometer.
Implementations
impl<'config> Gasometer<'config>
[src]
impl<'config> Gasometer<'config>
[src]pub fn new(gas_limit: u64, config: &'config Config) -> Self
[src]
pub fn new(gas_limit: u64, config: &'config Config) -> Self
[src]Create a new gasometer with given gas limit and config.
pub fn gas_cost(&self, cost: GasCost, gas: u64) -> Result<u64, ExitError>
[src]
pub fn gas_cost(&self, cost: GasCost, gas: u64) -> Result<u64, ExitError>
[src]Returns the numerical gas cost value.
pub fn total_used_gas(&self) -> u64
[src]
pub fn total_used_gas(&self) -> u64
[src]Total used gas.
pub fn refunded_gas(&self) -> i64
[src]
pub fn refunded_gas(&self) -> i64
[src]Refunded gas.
pub fn fail(&mut self) -> ExitError
[src]
pub fn fail(&mut self) -> ExitError
[src]Explictly fail the gasometer with out of gas. Return OutOfGas
error.
pub fn record_deposit(&mut self, len: usize) -> Result<(), ExitError>
[src]
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]
pub fn record_dynamic_cost(
&mut self,
cost: GasCost,
memory: Option<MemoryCost>
) -> Result<(), ExitError>
[src]Record opcode gas cost.
pub fn record_transaction(
&mut self,
cost: TransactionCost
) -> Result<(), ExitError>
[src]
pub fn record_transaction(
&mut self,
cost: TransactionCost
) -> Result<(), ExitError>
[src]Record transaction cost.
pub fn snapshot(&self) -> Result<Snapshot, ExitError>
[src]
Trait Implementations
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more