[][src]Trait deno::Loader

pub trait Loader {
type Error: Error + 'static;
    fn resolve(specifier: &str, referrer: &str) -> Result<String, Self::Error>;
fn load(&mut self, url: &str) -> Box<SourceCodeInfoFuture<Self::Error>>;
fn isolate_and_modules<'a: 'b + 'c, 'b, 'c>(
        &'a mut self
    ) -> (&'b mut Isolate, &'c mut Modules); fn isolate<'a: 'b, 'b>(&'a mut self) -> &'b mut Isolate { ... }
fn modules<'a: 'b, 'b>(&'a mut self) -> &'b mut Modules { ... } }

Associated Types

type Error: Error + 'static

Loading content...

Required methods

fn resolve(specifier: &str, referrer: &str) -> Result<String, Self::Error>

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(&mut self, url: &str) -> Box<SourceCodeInfoFuture<Self::Error>>

Given an absolute url, load its source code.

fn isolate_and_modules<'a: 'b + 'c, 'b, 'c>(
    &'a mut self
) -> (&'b mut Isolate, &'c mut Modules)

Loading content...

Provided methods

fn isolate<'a: 'b, 'b>(&'a mut self) -> &'b mut Isolate

fn modules<'a: 'b, 'b>(&'a mut self) -> &'b mut Modules

Loading content...

Implementors

Loading content...