pub trait BaseHost {
// Required method
fn get_label_and_source_file(
&self,
location: &Location,
) -> (SourceSpan, Option<Arc<SourceFile>>);
// Provided methods
fn resolve_event(&self, _event_id: EventId) -> Option<&EventName> { ... }
fn resolve_trace(&self, _trace_id: EventId) -> Option<&EventName> { ... }
}Expand description
Defines the host functionality shared by both sync and async execution.
There are two main categories of interactions between the VM and the host:
- getting a library’s MAST forest,
- handling VM events (regular events can mutate the process’ advice provider, while trace events are read-only),
Required Methods§
Sourcefn get_label_and_source_file(
&self,
location: &Location,
) -> (SourceSpan, Option<Arc<SourceFile>>)
fn get_label_and_source_file( &self, location: &Location, ) -> (SourceSpan, Option<Arc<SourceFile>>)
Returns the SourceSpan and optional SourceFile for the provided location.
Provided Methods§
Sourcefn resolve_event(&self, _event_id: EventId) -> Option<&EventName>
fn resolve_event(&self, _event_id: EventId) -> Option<&EventName>
Sourcefn resolve_trace(&self, _trace_id: EventId) -> Option<&EventName>
fn resolve_trace(&self, _trace_id: EventId) -> Option<&EventName>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".