pub struct LifecycleManager { /* private fields */ }Expand description
Lifecycle manager for component state coordination
Manages component lifecycle states, dependency resolution, initialization ordering, and graceful shutdown procedures across the modular system.
Implementations§
Source§impl LifecycleManager
impl LifecycleManager
Sourcepub fn register_component(
&mut self,
component_id: &str,
dependencies: Vec<String>,
) -> SklResult<()>
pub fn register_component( &mut self, component_id: &str, dependencies: Vec<String>, ) -> SklResult<()>
Register a component with the lifecycle manager
Sourcepub fn unregister_component(&mut self, component_id: &str) -> SklResult<()>
pub fn unregister_component(&mut self, component_id: &str) -> SklResult<()>
Unregister a component
Sourcepub fn set_component_state(
&mut self,
component_id: &str,
state: ComponentLifecycleState,
) -> SklResult<()>
pub fn set_component_state( &mut self, component_id: &str, state: ComponentLifecycleState, ) -> SklResult<()>
Set component state
Sourcepub fn get_component_state(
&self,
component_id: &str,
) -> Option<&ComponentLifecycleState>
pub fn get_component_state( &self, component_id: &str, ) -> Option<&ComponentLifecycleState>
Get component state
Sourcepub fn initialize_all_components(&mut self) -> SklResult<InitializationResult>
pub fn initialize_all_components(&mut self) -> SklResult<InitializationResult>
Initialize all components in dependency order
Sourcepub fn initialize_component(&mut self, component_id: &str) -> SklResult<()>
pub fn initialize_component(&mut self, component_id: &str) -> SklResult<()>
Initialize a specific component
Sourcepub fn shutdown_all_components(&mut self) -> SklResult<ShutdownResult>
pub fn shutdown_all_components(&mut self) -> SklResult<ShutdownResult>
Shutdown all components in reverse dependency order
Sourcepub fn shutdown_component(&mut self, component_id: &str) -> SklResult<()>
pub fn shutdown_component(&mut self, component_id: &str) -> SklResult<()>
Shutdown a specific component
Sourcepub fn add_listener(&mut self, event: LifecycleEvent, listener_id: &str)
pub fn add_listener(&mut self, event: LifecycleEvent, listener_id: &str)
Add a lifecycle event listener
Sourcepub fn remove_listener(&mut self, event: &LifecycleEvent, listener_id: &str)
pub fn remove_listener(&mut self, event: &LifecycleEvent, listener_id: &str)
Remove a lifecycle event listener
Sourcepub fn get_metrics(&self) -> &LifecycleMetrics
pub fn get_metrics(&self) -> &LifecycleMetrics
Get lifecycle metrics
Sourcepub fn get_all_states(&self) -> &HashMap<String, ComponentLifecycleState>
pub fn get_all_states(&self) -> &HashMap<String, ComponentLifecycleState>
Get all component states
Sourcepub fn all_components_in_state(&self, state: &ComponentLifecycleState) -> bool
pub fn all_components_in_state(&self, state: &ComponentLifecycleState) -> bool
Check if all components are in a specific state
Sourcepub fn get_components_in_state(
&self,
state: &ComponentLifecycleState,
) -> Vec<String>
pub fn get_components_in_state( &self, state: &ComponentLifecycleState, ) -> Vec<String>
Get components in a specific state
Trait Implementations§
Source§impl Debug for LifecycleManager
impl Debug for LifecycleManager
Auto Trait Implementations§
impl Freeze for LifecycleManager
impl RefUnwindSafe for LifecycleManager
impl Send for LifecycleManager
impl Sync for LifecycleManager
impl Unpin for LifecycleManager
impl UnwindSafe for LifecycleManager
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> 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