pub struct Runtime { /* private fields */ }Expand description
EVM runtime.
The runtime wraps an EVM Machine with support of return data and context.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new(
code: Rc<Vec<u8>>,
data: Rc<Vec<u8>>,
context: Context,
stack_limit: usize,
memory_limit: usize,
) -> Self
pub fn new( code: Rc<Vec<u8>>, data: Rc<Vec<u8>>, context: Context, stack_limit: usize, memory_limit: usize, ) -> Self
Create a new runtime with given code and data.
Sourcepub fn run<H: Handler + InterpreterHandler>(
&mut self,
handler: &mut H,
) -> Capture<ExitReason, Resolve<'_, H>>
pub fn run<H: Handler + InterpreterHandler>( &mut self, handler: &mut H, ) -> Capture<ExitReason, Resolve<'_, H>>
Loop stepping the runtime until it stops.
Sourcepub fn finish_create(
&mut self,
reason: ExitReason,
address: Option<H160>,
return_data: Vec<u8>,
) -> Result<(), ExitReason>
pub fn finish_create( &mut self, reason: ExitReason, address: Option<H160>, return_data: Vec<u8>, ) -> Result<(), ExitReason>
§Errors
Return ExitReason
Sourcepub fn finish_call(
&mut self,
reason: ExitReason,
return_data: Vec<u8>,
) -> Result<(), ExitReason>
pub fn finish_call( &mut self, reason: ExitReason, return_data: Vec<u8>, ) -> Result<(), ExitReason>
§Errors
Return ExitReason
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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