pub struct CliLifecycleManager { /* private fields */ }Expand description
Lifecycle mode manager for CLI
Manages mode transitions and determines which nodes should run in each mode. This is a lightweight adapter that doesn’t depend on the full runtime.
Implementations§
Source§impl CliLifecycleManager
impl CliLifecycleManager
Sourcepub fn from_project_config(config: &ProjectConfig) -> Option<Self>
pub fn from_project_config(config: &ProjectConfig) -> Option<Self>
Create a new CLI lifecycle manager from project config
Returns None if project doesn’t have lifecycle configuration
Sourcepub fn current_mode(&self) -> &str
pub fn current_mode(&self) -> &str
Get the current mode
Sourcepub fn nodes_for_current_mode(&self) -> Vec<String>
pub fn nodes_for_current_mode(&self) -> Vec<String>
Get list of nodes that should run in the current mode
Sourcepub fn calculate_mode_diff(
&self,
target_mode: &str,
) -> Result<ModeTransitionDiff>
pub fn calculate_mode_diff( &self, target_mode: &str, ) -> Result<ModeTransitionDiff>
Calculate what changes are needed to transition to target mode
Returns the diff (nodes to start/stop) without changing state.
Sourcepub fn mark_nodes_running(&mut self, nodes: &[String])
pub fn mark_nodes_running(&mut self, nodes: &[String])
Mark nodes as running (after spawning them)
Sourcepub fn mark_nodes_stopped(&mut self, nodes: &[String])
pub fn mark_nodes_stopped(&mut self, nodes: &[String])
Mark nodes as stopped (after killing them)
Sourcepub fn change_mode(&mut self, target_mode: &str) -> Result<ModeTransitionDiff>
pub fn change_mode(&mut self, target_mode: &str) -> Result<ModeTransitionDiff>
Change to a new mode (updates internal state only)
Returns the diff of what needs to change. Caller is responsible for actually spawning/killing processes.
Sourcepub fn available_modes(&self) -> Vec<&str>
pub fn available_modes(&self) -> Vec<&str>
Get available modes
Auto Trait Implementations§
impl Freeze for CliLifecycleManager
impl RefUnwindSafe for CliLifecycleManager
impl Send for CliLifecycleManager
impl Sync for CliLifecycleManager
impl Unpin for CliLifecycleManager
impl UnwindSafe for CliLifecycleManager
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