pub struct ModuleLoader { /* private fields */ }
Expand description
Module loader for orchestrating module loading process
Implementations§
Source§impl ModuleLoader
impl ModuleLoader
Sourcepub fn new() -> ModuleLoader
pub fn new() -> ModuleLoader
Create a new module loader
Sourcepub fn with_registry(registry: ModuleRegistry) -> ModuleLoader
pub fn with_registry(registry: ModuleRegistry) -> ModuleLoader
Create a new module loader with existing registry
Sourcepub fn register_modules<M>(&mut self, modules: Vec<M>)where
M: Module + 'static,
pub fn register_modules<M>(&mut self, modules: Vec<M>)where
M: Module + 'static,
Register multiple modules at once
Sourcepub async fn load(&mut self) -> Result<Container, ModuleError>
pub async fn load(&mut self) -> Result<Container, ModuleError>
Load all modules and create container
Sourcepub fn load_modules_only(&mut self) -> Result<(), ModuleError>
pub fn load_modules_only(&mut self) -> Result<(), ModuleError>
Load modules without creating container (for testing)
Sourcepub fn loading_stats(&self) -> &LoadingStats
pub fn loading_stats(&self) -> &LoadingStats
Get loading statistics
Sourcepub fn registry(&self) -> &ModuleRegistry
pub fn registry(&self) -> &ModuleRegistry
Get module registry
Sourcepub fn registry_mut(&mut self) -> &mut ModuleRegistry
pub fn registry_mut(&mut self) -> &mut ModuleRegistry
Get mutable module registry
Sourcepub fn routes(&mut self) -> Vec<RouteDefinition>
pub fn routes(&mut self) -> Vec<RouteDefinition>
Get all routes from loaded modules
Sourcepub fn middleware(&mut self) -> Vec<MiddlewareDefinition>
pub fn middleware(&mut self) -> Vec<MiddlewareDefinition>
Get all middleware from loaded modules
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print loading summary
Trait Implementations§
Source§impl Default for ModuleLoader
impl Default for ModuleLoader
Source§fn default() -> ModuleLoader
fn default() -> ModuleLoader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModuleLoader
impl !RefUnwindSafe for ModuleLoader
impl Send for ModuleLoader
impl Sync for ModuleLoader
impl Unpin for ModuleLoader
impl !UnwindSafe for ModuleLoader
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more