pub struct ExecutionContext<'a> { /* private fields */ }Expand description
EVMC context structure. Exposes the EVMC host functions, message data, and transaction context to the executing VM.
Implementations§
Source§impl<'a> ExecutionContext<'a>
impl<'a> ExecutionContext<'a>
pub fn new( host: &'a evmc_host_interface, _context: *mut evmc_host_context, ) -> Self
Sourcepub fn get_tx_context(&self) -> &ExecutionTxContext
pub fn get_tx_context(&self) -> &ExecutionTxContext
Retrieve the transaction context.
Sourcepub fn account_exists(&self, address: &Address) -> bool
pub fn account_exists(&self, address: &Address) -> bool
Check if an account exists.
Sourcepub fn get_storage(&self, address: &Address, key: &Bytes32) -> Bytes32
pub fn get_storage(&self, address: &Address, key: &Bytes32) -> Bytes32
Read from a storage key.
Sourcepub fn set_storage(
&mut self,
address: &Address,
key: &Bytes32,
value: &Bytes32,
) -> StorageStatus
pub fn set_storage( &mut self, address: &Address, key: &Bytes32, value: &Bytes32, ) -> StorageStatus
Set value of a storage key.
Sourcepub fn get_balance(&self, address: &Address) -> Uint256
pub fn get_balance(&self, address: &Address) -> Uint256
Get balance of an account.
Sourcepub fn get_code_size(&self, address: &Address) -> usize
pub fn get_code_size(&self, address: &Address) -> usize
Get code size of an account.
Sourcepub fn get_code_hash(&self, address: &Address) -> Bytes32
pub fn get_code_hash(&self, address: &Address) -> Bytes32
Get code hash of an account.
Sourcepub fn copy_code(
&self,
address: &Address,
code_offset: usize,
buffer: &mut [u8],
) -> usize
pub fn copy_code( &self, address: &Address, code_offset: usize, buffer: &mut [u8], ) -> usize
Copy code of an account.
Sourcepub fn selfdestruct(&mut self, address: &Address, beneficiary: &Address)
pub fn selfdestruct(&mut self, address: &Address, beneficiary: &Address)
Self-destruct the current account.
Sourcepub fn call(&mut self, message: &ExecutionMessage) -> ExecutionResult
pub fn call(&mut self, message: &ExecutionMessage) -> ExecutionResult
Call to another account.
Sourcepub fn get_block_hash(&self, num: i64) -> Bytes32
pub fn get_block_hash(&self, num: i64) -> Bytes32
Get block hash of an account.
Sourcepub fn access_account(&mut self, address: &Address) -> AccessStatus
pub fn access_account(&mut self, address: &Address) -> AccessStatus
Access an account.
Sourcepub fn access_storage(
&mut self,
address: &Address,
key: &Bytes32,
) -> AccessStatus
pub fn access_storage( &mut self, address: &Address, key: &Bytes32, ) -> AccessStatus
Access a storage key.
Auto Trait Implementations§
impl<'a> Freeze for ExecutionContext<'a>
impl<'a> RefUnwindSafe for ExecutionContext<'a>
impl<'a> !Send for ExecutionContext<'a>
impl<'a> !Sync for ExecutionContext<'a>
impl<'a> Unpin for ExecutionContext<'a>
impl<'a> UnwindSafe for ExecutionContext<'a>
Blanket Implementations§
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