pub struct RetryManager { /* private fields */ }Expand description
Retry manager with circuit breaker
Implementations§
Source§impl RetryManager
impl RetryManager
pub fn new( strategy: RetryStrategy, circuit_breaker_config: CircuitBreakerConfig, ) -> Self
Sourcepub async fn execute_with_retry<F, T, E>(
&mut self,
operation_name: &str,
operation: F,
) -> Result<T, RetryError>
pub async fn execute_with_retry<F, T, E>( &mut self, operation_name: &str, operation: F, ) -> Result<T, RetryError>
Execute an operation with retry logic
Sourcepub fn get_operation_stats(
&self,
operation_name: &str,
) -> Option<&OperationStats>
pub fn get_operation_stats( &self, operation_name: &str, ) -> Option<&OperationStats>
Get operation statistics
Sourcepub fn get_all_stats(&self) -> &HashMap<String, OperationStats>
pub fn get_all_stats(&self) -> &HashMap<String, OperationStats>
Get all operation statistics
Sourcepub fn reset_circuit_breaker(&mut self)
pub fn reset_circuit_breaker(&mut self)
Reset circuit breaker
Sourcepub fn update_strategy(&mut self, strategy: RetryStrategy)
pub fn update_strategy(&mut self, strategy: RetryStrategy)
Update retry strategy
Auto Trait Implementations§
impl Freeze for RetryManager
impl RefUnwindSafe for RetryManager
impl Send for RetryManager
impl Sync for RetryManager
impl Unpin for RetryManager
impl UnwindSafe for RetryManager
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