pub struct ModuleRegistry { /* private fields */ }Expand description
Registry for managing Backbone modules
The registry handles:
- Module registration
- Dependency resolution and ordering
- Migration path discovery
- Module lifecycle (boot, shutdown)
Implementations§
Source§impl ModuleRegistry
impl ModuleRegistry
Sourcepub fn register<M: BackboneModule + 'static>(
&mut self,
module: M,
) -> ModuleRegistryResult<()>
pub fn register<M: BackboneModule + 'static>( &mut self, module: M, ) -> ModuleRegistryResult<()>
Sourcepub fn register_arc(
&mut self,
module: Arc<dyn BackboneModule>,
) -> ModuleRegistryResult<()>
pub fn register_arc( &mut self, module: Arc<dyn BackboneModule>, ) -> ModuleRegistryResult<()>
Registers an Arc-wrapped module with the registry
Sourcepub fn module_names(&self) -> Vec<String>
pub fn module_names(&self) -> Vec<String>
Returns all module names
Sourcepub fn modules_ordered(
&mut self,
) -> ModuleRegistryResult<Vec<Arc<dyn BackboneModule>>>
pub fn modules_ordered( &mut self, ) -> ModuleRegistryResult<Vec<Arc<dyn BackboneModule>>>
Returns all modules in dependency order
Modules with no dependencies come first, followed by modules whose dependencies have already been returned.
§Returns
An error if there are circular dependencies or unknown dependencies
Sourcepub fn all_migration_paths(
&mut self,
) -> ModuleRegistryResult<Vec<MigrationInfo>>
pub fn all_migration_paths( &mut self, ) -> ModuleRegistryResult<Vec<MigrationInfo>>
Returns all migration paths in dependency order
§Returns
A vector of (module_name, migrations_path) tuples
Sourcepub fn all_seed_paths(&mut self) -> ModuleRegistryResult<Vec<SeedInfo>>
pub fn all_seed_paths(&mut self) -> ModuleRegistryResult<Vec<SeedInfo>>
Returns all seed paths in dependency order
Sourcepub async fn shutdown_all(&mut self) -> Result<()>
pub async fn shutdown_all(&mut self) -> Result<()>
Shuts down all modules in reverse dependency order
Sourcepub async fn health_check_all(&self) -> HashMap<String, bool>
pub async fn health_check_all(&self) -> HashMap<String, bool>
Performs health checks on all modules
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Prints a summary of registered modules
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleRegistry
impl !UnwindSafe for ModuleRegistry
impl Freeze for ModuleRegistry
impl Send for ModuleRegistry
impl Sync for ModuleRegistry
impl Unpin for ModuleRegistry
impl UnsafeUnpin for ModuleRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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