Struct ketos::module::ModuleRegistry
[−]
[src]
pub struct ModuleRegistry { /* fields omitted */ }
Loads modules into the running program and caches previously loaded modules
Methods
impl ModuleRegistry
[src]
fn new(loader: Box<ModuleLoader>) -> ModuleRegistry
Creates a new ModuleRegistry
using the given ModuleLoader
to load new modules.
fn add_module(&self, name: Name, module: Module) -> Option<Module>
Inserts a named module into the registry.
fn get_module(&self, name: Name) -> Option<Module>
Returns the named module, only if it is already loaded.
fn load_module(&self, name: Name, ctx: &Context) -> Result<Module, Error>
Returns a loaded module. If the module has not been loaded in this
registry; the contained ModuleLoader
instance will be used to load it.