pub struct RetryConfig<P: RetryPolicy = DefaultRetryPolicy, B: BackoffStrategy = ExponentialBackoff> {
pub max_retries: u32,
pub policy: P,
pub backoff: B,
pub total_timeout: Option<Duration>,
}Expand description
Complete retry configuration combining policy and backoff.
Fields§
§max_retries: u32Maximum number of retry attempts.
policy: PPolicy determining which errors to retry.
backoff: BBackoff strategy for calculating delays.
total_timeout: Option<Duration>Maximum total time for all retries.
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn builder() -> RetryConfigBuilder<DefaultRetryPolicy, ExponentialBackoff>
pub fn builder() -> RetryConfigBuilder<DefaultRetryPolicy, ExponentialBackoff>
Create a configuration builder.
Sourcepub fn disabled() -> RetryConfig<NoRetryPolicy, NoBackoff>
pub fn disabled() -> RetryConfig<NoRetryPolicy, NoBackoff>
Disable retries.
Source§impl<P: RetryPolicy, B: BackoffStrategy> RetryConfig<P, B>
impl<P: RetryPolicy, B: BackoffStrategy> RetryConfig<P, B>
Trait Implementations§
Source§impl<P: Clone + RetryPolicy, B: Clone + BackoffStrategy> Clone for RetryConfig<P, B>
impl<P: Clone + RetryPolicy, B: Clone + BackoffStrategy> Clone for RetryConfig<P, B>
Source§fn clone(&self) -> RetryConfig<P, B>
fn clone(&self) -> RetryConfig<P, B>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: Debug + RetryPolicy, B: Debug + BackoffStrategy> Debug for RetryConfig<P, B>
impl<P: Debug + RetryPolicy, B: Debug + BackoffStrategy> Debug for RetryConfig<P, B>
Auto Trait Implementations§
impl<P, B> Freeze for RetryConfig<P, B>
impl<P, B> RefUnwindSafe for RetryConfig<P, B>where
P: RefUnwindSafe,
B: RefUnwindSafe,
impl<P, B> Send for RetryConfig<P, B>
impl<P, B> Sync for RetryConfig<P, B>
impl<P, B> Unpin for RetryConfig<P, B>
impl<P, B> UnwindSafe for RetryConfig<P, B>where
P: UnwindSafe,
B: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request