pub struct Machine<W: Word> {
pub address: W::Addr,
pub code: Vec<u8>,
pub pc: usize,
pub gas_used: usize,
pub stack: Vec<W>,
pub memory: Vec<u8>,
pub transient: HashMap<W, W>,
pub last_return: Option<Vec<u8>>,
}Fields§
§address: W::Addr§code: Vec<u8>§pc: usize§gas_used: usize§stack: Vec<W>§memory: Vec<u8>§transient: HashMap<W, W>§last_return: Option<Vec<u8>>Implementations§
Source§impl<W: Word> Machine<W>
impl<W: Word> Machine<W>
pub fn new(address: W::Addr, code: Vec<u8>) -> Self
pub fn run<C: Context<W>>( self, ctx: &mut C, call_info: &CallInfo<W>, ) -> Result<ExecutionResult, ExecError>
pub fn mem_put( &mut self, target_offset: usize, source: &[u8], source_offset: usize, len: usize, )
pub fn mem_get(&mut self, offset: usize, size: usize) -> Vec<u8> ⓘ
pub fn pop_stack(&mut self) -> Result<W, ExecError>
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for Machine<W>
impl<W> RefUnwindSafe for Machine<W>
impl<W> Send for Machine<W>
impl<W> Sync for Machine<W>
impl<W> Unpin for Machine<W>
impl<W> UnwindSafe for Machine<W>
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