Trait ketos::module::ModuleLoader [] [src]

pub trait ModuleLoader {
    fn load_module(&self, name: Name, ctx: Context) -> Result<Module, Error>;

    fn chain<T: ModuleLoader>(self, second: T) -> ChainModuleLoader<Self, T> where Self: Sized { ... }
}

Provides a method for loading modules into a running interpreter.

Required Methods

Loads the named module, supplying a new execution context.

If the loader cannot load the named module, an error value should be returned of Err(Error::CompileError(CompileError::ModuleError(name))).

Provided Methods

Creates a ChainModuleLoader using this loader and another.

The ChainModuleLoader will attempt to load a module first from self, falling back on the supplied ModuleLoader if it unable to find a module.

Implementors