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

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

fn load_module(&self, name: Name, ctx: Context) -> Result<Module, Error>

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))).

Loading content...

Provided methods

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

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.

Loading content...

Implementors

impl ModuleLoader for BuiltinModuleLoader[src]

impl ModuleLoader for FileModuleLoader[src]

impl ModuleLoader for NullModuleLoader[src]

impl<A, B> ModuleLoader for ChainModuleLoader<A, B> where
    A: ModuleLoader,
    B: ModuleLoader
[src]

Loading content...