pub struct ErrorRecoveryManager { /* private fields */ }
Expand description
Error recovery manager
Implementations§
Source§impl ErrorRecoveryManager
impl ErrorRecoveryManager
Sourcepub fn with_metrics(metrics: Arc<dyn Metrics>) -> Self
pub fn with_metrics(metrics: Arc<dyn Metrics>) -> Self
Create a new error recovery manager with metrics
Sourcepub fn register_strategy(
&mut self,
error_type: ErrorType,
strategy: Box<dyn RecoveryStrategy>,
)
pub fn register_strategy( &mut self, error_type: ErrorType, strategy: Box<dyn RecoveryStrategy>, )
Register a recovery strategy for a specific error type
Sourcepub async fn handle_error(
&self,
error: &AiLibError,
context: &ErrorContext,
) -> Result<(), AiLibError>
pub async fn handle_error( &self, error: &AiLibError, context: &ErrorContext, ) -> Result<(), AiLibError>
Handle an error and attempt recovery
Sourcepub fn get_error_patterns(&self) -> HashMap<ErrorType, ErrorPattern>
pub fn get_error_patterns(&self) -> HashMap<ErrorType, ErrorPattern>
Get error patterns for analysis
Sourcepub fn get_error_statistics(&self) -> ErrorStatistics
pub fn get_error_statistics(&self) -> ErrorStatistics
Get error statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorRecoveryManager
impl !RefUnwindSafe for ErrorRecoveryManager
impl Send for ErrorRecoveryManager
impl Sync for ErrorRecoveryManager
impl Unpin for ErrorRecoveryManager
impl !UnwindSafe for ErrorRecoveryManager
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