pub struct ErrorPattern {
pub id: String,
pub keywords: Vec<String>,
pub fix: FixAction,
pub applications: usize,
pub successes: usize,
pub source: PatternSource,
}Expand description
Error pattern with learned success rate
Fields§
§id: StringPattern identifier
keywords: Vec<String>Keywords that match this error
fix: FixActionSuggested fix action
applications: usizeNumber of times pattern was applied
successes: usizeNumber of successful fixes
source: PatternSourceSource of pattern (bootstrap, llm, corpus)
Implementations§
Source§impl ErrorPattern
impl ErrorPattern
Sourcepub fn new(id: impl Into<String>, keywords: Vec<String>, fix: FixAction) -> Self
pub fn new(id: impl Into<String>, keywords: Vec<String>, fix: FixAction) -> Self
Create new error pattern
Sourcepub fn success_rate(&self) -> f32
pub fn success_rate(&self) -> f32
Calculate success rate
Sourcepub fn should_retire(&self) -> bool
pub fn should_retire(&self) -> bool
Check if pattern should be retired
Per spec: “Patterns with <30% success rate after 5 applications are automatically retired.”
Sourcepub fn record_application(&mut self, success: bool)
pub fn record_application(&mut self, success: bool)
Record application of this pattern
Sourcepub fn match_confidence(&self, error_message: &str) -> f32
pub fn match_confidence(&self, error_message: &str) -> f32
Calculate match confidence (0.0 - 1.0)
Trait Implementations§
Source§impl Clone for ErrorPattern
impl Clone for ErrorPattern
Source§fn clone(&self) -> ErrorPattern
fn clone(&self) -> ErrorPattern
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 moreAuto Trait Implementations§
impl Freeze for ErrorPattern
impl RefUnwindSafe for ErrorPattern
impl Send for ErrorPattern
impl Sync for ErrorPattern
impl Unpin for ErrorPattern
impl UnwindSafe for ErrorPattern
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> 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