pub struct RecoveryStrategy {
pub description: String,
pub steps: Vec<String>,
pub success_count: u32,
pub failure_count: u32,
pub avg_recovery_time_ms: f32,
pub context_tags: Vec<String>,
pub last_used: u64,
}Expand description
A learned recovery strategy
Fields§
§description: StringStrategy description
steps: Vec<String>Steps to perform
success_count: u32Success count
failure_count: u32Failure count
avg_recovery_time_ms: f32Average time to recovery (ms)
Context tags
last_used: u64Last used timestamp
Implementations§
Source§impl RecoveryStrategy
impl RecoveryStrategy
Sourcepub fn success_rate(&self) -> f32
pub fn success_rate(&self) -> f32
Get success rate
Sourcepub fn similarity(&self, other: &RecoveryStrategy) -> f32
pub fn similarity(&self, other: &RecoveryStrategy) -> f32
Compute similarity with another strategy
Sourcepub fn merge(&mut self, other: &RecoveryStrategy)
pub fn merge(&mut self, other: &RecoveryStrategy)
Merge with another strategy (combine stats)
Sourcepub fn record_success(&mut self, recovery_time_ms: u64)
pub fn record_success(&mut self, recovery_time_ms: u64)
Record a success
Sourcepub fn record_failure(&mut self)
pub fn record_failure(&mut self)
Record a failure
Trait Implementations§
Source§impl Clone for RecoveryStrategy
impl Clone for RecoveryStrategy
Source§fn clone(&self) -> RecoveryStrategy
fn clone(&self) -> RecoveryStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RecoveryStrategy
impl Debug for RecoveryStrategy
Source§impl<'de> Deserialize<'de> for RecoveryStrategy
impl<'de> Deserialize<'de> for RecoveryStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RecoveryStrategy
impl RefUnwindSafe for RecoveryStrategy
impl Send for RecoveryStrategy
impl Sync for RecoveryStrategy
impl Unpin for RecoveryStrategy
impl UnsafeUnpin for RecoveryStrategy
impl UnwindSafe for RecoveryStrategy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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