pub trait ModuleLoader {
// Required method
fn load_module(&self, name: Name, ctx: Context) -> Result<Module, Error>;
// Provided method
fn chain<T: ModuleLoader>(self, second: T) -> ChainModuleLoader<Self, T>
where Self: Sized { ... }
}
Expand description
Provides a method for loading modules into a running interpreter.
Required Methods§
Provided Methods§
Sourcefn chain<T: ModuleLoader>(self, second: T) -> ChainModuleLoader<Self, T>where
Self: Sized,
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.