pub trait Host: Send + Sync {
// Required methods
fn resolve_module(&self, base: String, name: String) -> Result<String>;
fn load_module(&self, name: String) -> Result<String>;
}Expand description
A trait representing the host environment for the JS runtime. In hyperlight this would represent the host function calls that the runtime needs.
Required Methods§
Sourcefn resolve_module(&self, base: String, name: String) -> Result<String>
fn resolve_module(&self, base: String, name: String) -> Result<String>
Resolve a module name to a module specifier (usually a path). The base is the specifier of the module that is importing the module.
Sourcefn load_module(&self, name: String) -> Result<String>
fn load_module(&self, name: String) -> Result<String>
Obtain the module source code for a given module specifier.