Skip to main content

Loader

Trait Loader 

Source
pub trait Loader {
    // Required method
    fn load<'js>(
        &mut self,
        ctx: &Ctx<'js>,
        name: &str,
        attributes: Option<ImportAttributes<'js>>,
    ) -> Result<Module<'js>, Error>;
}
Available on crate feature loader only.
Expand description

Module loader interface

Required Methods§

Source

fn load<'js>( &mut self, ctx: &Ctx<'js>, name: &str, attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Load module by name with import attributes

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Loader for ()

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B, C, D, E, F, G, H> Loader for (A, B, C, D, E, F, G, H)
where A: Loader, B: Loader, C: Loader, D: Loader, E: Loader, F: Loader, G: Loader, H: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B, C, D, E, F, G> Loader for (A, B, C, D, E, F, G)
where A: Loader, B: Loader, C: Loader, D: Loader, E: Loader, F: Loader, G: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B, C, D, E, F> Loader for (A, B, C, D, E, F)
where A: Loader, B: Loader, C: Loader, D: Loader, E: Loader, F: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B, C, D, E> Loader for (A, B, C, D, E)
where A: Loader, B: Loader, C: Loader, D: Loader, E: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B, C, D> Loader for (A, B, C, D)
where A: Loader, B: Loader, C: Loader, D: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B, C> Loader for (A, B, C)
where A: Loader, B: Loader, C: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A, B> Loader for (A, B)
where A: Loader, B: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Source§

impl<A> Loader for (A,)
where A: Loader,

Source§

fn load<'js>( &mut self, _ctx: &Ctx<'js>, name: &str, _attributes: Option<ImportAttributes<'js>>, ) -> Result<Module<'js>, Error>

Implementors§

Source§

impl Loader for BuiltinLoader

Source§

impl Loader for ModuleLoader

Source§

impl Loader for NativeLoader

Source§

impl Loader for ScriptLoader

Available on crate feature std only.
Source§

impl<D> Loader for Bundle<&'static Map<&'static str, D>>
where D: HasByteCode<'static>,

Available on crate feature phf only.
Source§

impl<D> Loader for Bundle<&'static [(&'static str, D)]>
where D: HasByteCode<'static>,

Source§

impl<L> Loader for Compile<L>
where L: Loader,