pub trait ModuleLoader {
// Required method
fn load(
&self,
specifier: &str,
attributes: &[(String, String)],
referrer: &str,
) -> Result<LoadedModule, String>;
}Expand description
How the host turns a specifier into bytes.
The engine cannot do this itself: resolving ./x.js needs to know that the importer
was a file, and where. A browser-shaped host would answer differently, so the host
supplies this and the engine decides what to do with the bytes.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".