pub struct LifecycleManager { /* private fields */ }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 !RefUnwindSafe for LifecycleManager
impl !UnwindSafe for LifecycleManager
impl Freeze for LifecycleManager
impl Send for LifecycleManager
impl Sync for LifecycleManager
impl Unpin for LifecycleManager
impl UnsafeUnpin 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> 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