pub struct RecoveryManager { /* private fields */ }Expand description
Global recovery manager
Implementations§
Source§impl RecoveryManager
impl RecoveryManager
Sourcepub async fn set_default_policy(&self, policy: RecoveryPolicy)
pub async fn set_default_policy(&self, policy: RecoveryPolicy)
Set default recovery policy
Sourcepub async fn set_policy(&self, node_id: &str, policy: RecoveryPolicy)
pub async fn set_policy(&self, node_id: &str, policy: RecoveryPolicy)
Set recovery policy for a specific node
Sourcepub async fn get_policy(&self, node_id: &str) -> RecoveryPolicy
pub async fn get_policy(&self, node_id: &str) -> RecoveryPolicy
Get recovery policy for a node
Sourcepub async fn get_history(&self, node_id: &str) -> RecoveryHistory
pub async fn get_history(&self, node_id: &str) -> RecoveryHistory
Get recovery history for a node
Sourcepub async fn record_attempt(&self, node_id: &str, attempt: RecoveryAttempt)
pub async fn record_attempt(&self, node_id: &str, attempt: RecoveryAttempt)
Record a recovery attempt
Sourcepub async fn determine_action(
&self,
node_id: &str,
current_state: NodeState,
) -> RecoveryAction
pub async fn determine_action( &self, node_id: &str, current_state: NodeState, ) -> RecoveryAction
Determine recovery action for a node
Sourcepub async fn get_restart_delay(&self, node_id: &str) -> Duration
pub async fn get_restart_delay(&self, node_id: &str) -> Duration
Calculate delay before next restart
Sourcepub async fn mark_degraded(&self, node_id: &str)
pub async fn mark_degraded(&self, node_id: &str)
Mark node as degraded
Sourcepub async fn is_degraded(&self, node_id: &str) -> bool
pub async fn is_degraded(&self, node_id: &str) -> bool
Check if node is degraded
Sourcepub async fn list_degraded(&self) -> Vec<String>
pub async fn list_degraded(&self) -> Vec<String>
Get all degraded nodes
Sourcepub async fn clear_degraded(&self, node_id: &str)
pub async fn clear_degraded(&self, node_id: &str)
Clear degraded status
Sourcepub async fn get_stats(&self) -> RecoveryStats
pub async fn get_stats(&self) -> RecoveryStats
Get recovery statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RecoveryManager
impl !RefUnwindSafe for RecoveryManager
impl Send for RecoveryManager
impl Sync for RecoveryManager
impl Unpin for RecoveryManager
impl !UnwindSafe for RecoveryManager
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