[][src]Trait deno::Loader

pub trait Loader: Send + Sync {
    fn resolve(
        &self,
        specifier: &str,
        referrer: &str,
        is_main: bool,
        is_dyn_import: bool
    ) -> Result<ModuleSpecifier, ErrBox>;
fn load(
        &self,
        module_specifier: &ModuleSpecifier
    ) -> Box<SourceCodeInfoFuture>; }

Required methods

fn resolve(
    &self,
    specifier: &str,
    referrer: &str,
    is_main: bool,
    is_dyn_import: bool
) -> Result<ModuleSpecifier, ErrBox>

Returns an absolute URL. When implementing an spec-complaint VM, this should be exactly the algorithm described here: https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier

fn load(&self, module_specifier: &ModuleSpecifier) -> Box<SourceCodeInfoFuture>

Given ModuleSpecifier, load its source code.

Loading content...

Implementors

Loading content...