pub struct DefaultErrorHandler { /* private fields */ }Expand description
Default implementation of the error handler
Implementations§
Source§impl DefaultErrorHandler
impl DefaultErrorHandler
Sourcepub async fn new(config: ErrorHandlerConfig) -> Result<Self, ErrorHandlerError>
pub async fn new(config: ErrorHandlerConfig) -> Result<Self, ErrorHandlerError>
Create a new error handler
Trait Implementations§
Source§impl ErrorHandler for DefaultErrorHandler
impl ErrorHandler for DefaultErrorHandler
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,
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,
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,
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,
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,
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
Auto Trait Implementations§
impl Freeze for DefaultErrorHandler
impl !RefUnwindSafe for DefaultErrorHandler
impl Send for DefaultErrorHandler
impl Sync for DefaultErrorHandler
impl Unpin for DefaultErrorHandler
impl !UnwindSafe for DefaultErrorHandler
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> 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 more