pub struct LifecycleManager { /* private fields */ }Expand description
Lifecycle manager for mode-based node orchestration
Manages transitions between operational modes by starting and stopping nodes via the Supervisor.
Implementations§
Source§impl LifecycleManager
impl LifecycleManager
Sourcepub fn new(
supervisor: Arc<dyn SupervisorTrait>,
mode_config: HashMap<String, ModeConfig>,
default_mode: String,
) -> Self
pub fn new( supervisor: Arc<dyn SupervisorTrait>, mode_config: HashMap<String, ModeConfig>, default_mode: String, ) -> Self
Create a new lifecycle manager
§Arguments
supervisor- Supervisor instance for node managementmode_config- Map of mode name to mode configurationdefault_mode- Initial mode to start in
Sourcepub fn current_mode(&self) -> &str
pub fn current_mode(&self) -> &str
Get the current mode
Sourcepub fn running_nodes(&self) -> &HashSet<String>
pub fn running_nodes(&self) -> &HashSet<String>
Get running nodes
Sourcepub async fn change_mode(
&mut self,
target_mode: &str,
) -> Result<ModeTransitionResult>
pub async fn change_mode( &mut self, target_mode: &str, ) -> Result<ModeTransitionResult>
Sourcepub fn calculate_mode_diff(&self, target_mode: &str) -> Result<ModeDiff>
pub fn calculate_mode_diff(&self, target_mode: &str) -> Result<ModeDiff>
Calculate which nodes need to start/stop for a mode transition
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