pub struct State<M, P: Patch> {Show 14 fields
pub memory: M,
pub stack: Stack,
pub context: Context,
pub out: Rc<Vec<u8>>,
pub ret: Rc<Vec<u8>>,
pub memory_cost: Gas,
pub used_gas: GasUsage,
pub refunded_gas: Gas,
pub account_state: AccountState<P::Account>,
pub logs: Vec<Log>,
pub removed: Vec<Address>,
pub depth: usize,
pub valids: Valids,
pub position: usize,
}
Expand description
A VM state without PC.
Fields
memory: M
Memory of this runtime.
stack: Stack
Stack of this runtime.
context: Context
Context.
out: Rc<Vec<u8>>
The current out value.
ret: Rc<Vec<u8>>
Return data buffer.
memory_cost: Gas
The current memory cost. Note that this is different from memory gas.
used_gas: GasUsage
Used gas excluding memory gas.
refunded_gas: Gas
Refunded gas.
account_state: AccountState<P::Account>
The current account commitment states.
logs: Vec<Log>
Logs appended.
removed: Vec<Address>
All removed accounts using the SUICIDE opcode.
depth: usize
Depth of this runtime.
valids: Valids
Code valid maps.
position: usize
PC position.
Implementations
sourceimpl<M, P: Patch> State<M, P>
impl<M, P: Patch> State<M, P>
sourcepub fn memory_gas(&self) -> Gas
pub fn memory_gas(&self) -> Gas
Memory gas, part of total used gas.
sourcepub fn available_gas(&self) -> Gas
pub fn available_gas(&self) -> Gas
Available gas at this moment.
sourcepub fn total_used_gas(&self) -> Gas
pub fn total_used_gas(&self) -> Gas
Total used gas including the memory gas.
Auto Trait Implementations
impl<M, P> !RefUnwindSafe for State<M, P>
impl<M, P> !Send for State<M, P>
impl<M, P> !Sync for State<M, P>
impl<M, P> Unpin for State<M, P>where
M: Unpin,
<P as Patch>::Account: Unpin,
impl<M, P> UnwindSafe for State<M, P>where
M: UnwindSafe,
<P as Patch>::Account: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more