pub struct DefaultHost<A> { /* private fields */ }Expand description
A default Host implementation that provides the essential functionality required by the VM.
Implementations§
Source§impl<A: AdviceProvider> DefaultHost<A>
impl<A: AdviceProvider> DefaultHost<A>
pub fn new(adv_provider: A) -> Self
pub fn load_mast_forest( &mut self, mast_forest: Arc<MastForest>, ) -> Result<(), ExecutionError>
pub fn into_inner(self) -> A
Trait Implementations§
Source§impl<A: Clone> Clone for DefaultHost<A>
impl<A: Clone> Clone for DefaultHost<A>
Source§impl Default for DefaultHost<MemAdviceProvider>
impl Default for DefaultHost<MemAdviceProvider>
Source§impl<A: AdviceProvider> Host for DefaultHost<A>
impl<A: AdviceProvider> Host for DefaultHost<A>
type AdviceProvider = A
Source§fn advice_provider(&self) -> &Self::AdviceProvider
fn advice_provider(&self) -> &Self::AdviceProvider
Returns a reference to the advice provider.
Source§fn advice_provider_mut(&mut self) -> &mut Self::AdviceProvider
fn advice_provider_mut(&mut self) -> &mut Self::AdviceProvider
Returns a mutable reference to the advice provider.
Source§fn get_mast_forest(&self, node_digest: &RpoDigest) -> Option<Arc<MastForest>>
fn get_mast_forest(&self, node_digest: &RpoDigest) -> Option<Arc<MastForest>>
Returns MAST forest corresponding to the specified digest, or None if the MAST forest for
this digest could not be found in this Host.
Source§fn on_event(
&mut self,
_process: ProcessState<'_>,
_event_id: u32,
) -> Result<(), ExecutionError>
fn on_event( &mut self, _process: ProcessState<'_>, _event_id: u32, ) -> Result<(), ExecutionError>
Handles the event emitted from the VM.
Source§fn on_debug(
&mut self,
_process: ProcessState<'_>,
_options: &DebugOptions,
) -> Result<(), ExecutionError>
fn on_debug( &mut self, _process: ProcessState<'_>, _options: &DebugOptions, ) -> Result<(), ExecutionError>
Handles the debug request from the VM.
Source§fn on_trace(
&mut self,
_process: ProcessState<'_>,
_trace_id: u32,
) -> Result<(), ExecutionError>
fn on_trace( &mut self, _process: ProcessState<'_>, _trace_id: u32, ) -> Result<(), ExecutionError>
Handles the trace emitted from the VM.
Source§fn on_assert_failed(
&mut self,
process: ProcessState<'_>,
err_code: u32,
) -> ExecutionError
fn on_assert_failed( &mut self, process: ProcessState<'_>, err_code: u32, ) -> ExecutionError
Handles the failure of the assertion instruction.
Auto Trait Implementations§
impl<A> Freeze for DefaultHost<A>where
A: Freeze,
impl<A> RefUnwindSafe for DefaultHost<A>where
A: RefUnwindSafe,
impl<A> Send for DefaultHost<A>where
A: Send,
impl<A> Sync for DefaultHost<A>where
A: Sync,
impl<A> Unpin for DefaultHost<A>where
A: Unpin,
impl<A> UnwindSafe for DefaultHost<A>where
A: UnwindSafe,
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