Skip to main content

Host

Trait Host 

Source
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§

Source

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.

Source

fn load_module(&self, name: String) -> Result<String>

Obtain the module source code for a given module specifier.

Implementors§