pub trait ErrorHandler {
// Required methods
fn handle_error<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
error: RuntimeError,
) -> Pin<Box<dyn Future<Output = Result<ErrorAction, ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn register_strategy<'life0, 'async_trait>(
&'life0 self,
error_type: ErrorType,
strategy: RecoveryStrategy,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_error_stats<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<ErrorStatistics, ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_system_error_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SystemErrorStatistics> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_error_thresholds<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
thresholds: ErrorThresholds,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear_error_history<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Error handler trait
Required Methods§
Sourcefn handle_error<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
error: RuntimeError,
) -> Pin<Box<dyn Future<Output = Result<ErrorAction, ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_error<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
error: RuntimeError,
) -> Pin<Box<dyn Future<Output = Result<ErrorAction, ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an error for a specific agent
Sourcefn register_strategy<'life0, 'async_trait>(
&'life0 self,
error_type: ErrorType,
strategy: RecoveryStrategy,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_strategy<'life0, 'async_trait>(
&'life0 self,
error_type: ErrorType,
strategy: RecoveryStrategy,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register an error recovery strategy
Sourcefn get_error_stats<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<ErrorStatistics, ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_error_stats<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<ErrorStatistics, ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get error statistics for an agent
Sourcefn get_system_error_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SystemErrorStatistics> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_system_error_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SystemErrorStatistics> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get system-wide error statistics
Sourcefn set_error_thresholds<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
thresholds: ErrorThresholds,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_error_thresholds<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
thresholds: ErrorThresholds,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set error thresholds for an agent
Sourcefn clear_error_history<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_error_history<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear error history for an agent