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
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.