pub struct ModuleRegistry { /* private fields */ }Expand description
Registry of available module loaders.
Modules are registered at startup and looked up by name during configuration parsing. The registry is thread-safe and can be shared across the application.
Implementations§
Source§impl ModuleRegistry
impl ModuleRegistry
Sourcepub fn register(&mut self, loader: Box<dyn ModuleLoader>)
pub fn register(&mut self, loader: Box<dyn ModuleLoader>)
Register a module loader. If a loader with the same name already exists, it is replaced.
Sourcepub fn get(&self, name: &str) -> Option<&dyn ModuleLoader>
pub fn get(&self, name: &str) -> Option<&dyn ModuleLoader>
Look up a loader by directive name.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &dyn ModuleLoader)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &dyn ModuleLoader)>
Iterate over all registered loaders.
Sourcepub fn load_all(&self) -> ModuleResult<()>
pub fn load_all(&self) -> ModuleResult<()>
Call on_load on all registered modules.
Sourcepub fn unload_all(&self)
pub fn unload_all(&self)
Call on_unload on all registered modules.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModuleRegistry
impl !RefUnwindSafe for ModuleRegistry
impl Send for ModuleRegistry
impl Sync for ModuleRegistry
impl Unpin for ModuleRegistry
impl UnsafeUnpin for ModuleRegistry
impl !UnwindSafe for ModuleRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more