Skip to main content

ErrorHandler

Trait ErrorHandler 

Source
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§

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown the error handler

Implementors§