pub struct ErrorLearner { /* private fields */ }Expand description
Error pattern learner
Implementations§
Source§impl ErrorLearner
impl ErrorLearner
pub fn new(config: SelfHealingConfig) -> Self
Sourcepub fn record(&self, error: ErrorOccurrence)
pub fn record(&self, error: ErrorOccurrence)
Record an error occurrence
Sourcepub fn record_recovery(&self, pattern_id: &str, strategy: &str, success: bool)
pub fn record_recovery(&self, pattern_id: &str, strategy: &str, success: bool)
Record recovery result
Sourcepub fn patterns(&self) -> Vec<ErrorPattern>
pub fn patterns(&self) -> Vec<ErrorPattern>
Get patterns
Sourcepub fn recommend_recovery(
&self,
error_type: &str,
context: &str,
) -> Option<RecoveryStrategy>
pub fn recommend_recovery( &self, error_type: &str, context: &str, ) -> Option<RecoveryStrategy>
Get recommended recovery for error
Sourcepub fn summary(&self) -> LearnerSummary
pub fn summary(&self) -> LearnerSummary
Get summary
Source§impl ErrorLearner
impl ErrorLearner
Sourcepub fn save_patterns(&self, path: &Path) -> Result<()>
pub fn save_patterns(&self, path: &Path) -> Result<()>
Save patterns and recovery history to a JSON file.
Sourcepub fn load_patterns(&self, path: &Path) -> Result<()>
pub fn load_patterns(&self, path: &Path) -> Result<()>
Load patterns and recovery history from a JSON file.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ErrorLearner
impl !RefUnwindSafe for ErrorLearner
impl Send for ErrorLearner
impl Sync for ErrorLearner
impl Unpin for ErrorLearner
impl UnsafeUnpin for ErrorLearner
impl UnwindSafe for ErrorLearner
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request