pub struct ErrorRecoverySystem {
pub max_retries: u32,
pub retry_delay_ms: u64,
pub log_errors: bool,
}Expand description
Error recovery and resilience system
Fields§
§max_retries: u32Maximum retry attempts
retry_delay_ms: u64Retry delay in milliseconds
log_errors: boolWhether to log errors
Implementations§
Source§impl ErrorRecoverySystem
impl ErrorRecoverySystem
Sourcepub fn new() -> ErrorRecoverySystem
pub fn new() -> ErrorRecoverySystem
Create a new error recovery system
Sourcepub async fn execute_with_retry<F, T, E>(
&self,
operation: F,
) -> Result<T, Error>
pub async fn execute_with_retry<F, T, E>( &self, operation: F, ) -> Result<T, Error>
Execute an operation with retry logic
Sourcepub fn handle_invalid_method(&self, method: &str) -> Error
pub fn handle_invalid_method(&self, method: &str) -> Error
Handle invalid method calls gracefully
Sourcepub fn handle_invalid_parameters(&self, method: &str, error: &str) -> Error
pub fn handle_invalid_parameters(&self, method: &str, error: &str) -> Error
Handle invalid parameters gracefully
Sourcepub fn handle_resource_error(&self, uri: &str, error: &str) -> Error
pub fn handle_resource_error(&self, uri: &str, error: &str) -> Error
Handle resource access errors gracefully
Trait Implementations§
Source§impl Default for ErrorRecoverySystem
impl Default for ErrorRecoverySystem
Source§fn default() -> ErrorRecoverySystem
fn default() -> ErrorRecoverySystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorRecoverySystem
impl RefUnwindSafe for ErrorRecoverySystem
impl Send for ErrorRecoverySystem
impl Sync for ErrorRecoverySystem
impl Unpin for ErrorRecoverySystem
impl UnsafeUnpin for ErrorRecoverySystem
impl UnwindSafe for ErrorRecoverySystem
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