pub struct RetryConfig {
pub initial_interval: Duration,
pub randomization_factor: f64,
pub multiplier: f64,
pub max_interval: Duration,
pub max_elapsed_time: Option<Duration>,
pub max_retries: usize,
}
Expand description
Configuration for retrying requests to the server
Fields§
§initial_interval: Duration
initial wait time before the first retry.
randomization_factor: f64
randomization jitter that is used as a multiplier for the current retry interval and is added or subtracted from the interval length.
multiplier: f64
rate at which retry time should be increased, until it reaches max_interval.
max_interval: Duration
maximum amount of time to wait between retries.
max_elapsed_time: Option<Duration>
maximum total amount of time requests should be retried for, if None is set then no limit will be used.
max_retries: usize
maximum number of retry attempts.
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub const fn no_retries() -> Self
pub const fn no_retries() -> Self
A retry policy that never retires
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
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 Debug for RetryConfig
impl Debug for RetryConfig
Source§impl Default for RetryConfig
impl Default for RetryConfig
Source§impl From<RetryConfig> for ExponentialBackoff
impl From<RetryConfig> for ExponentialBackoff
Source§fn from(c: RetryConfig) -> Self
fn from(c: RetryConfig) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RetryConfig
impl PartialEq for RetryConfig
impl StructuralPartialEq for RetryConfig
Auto Trait Implementations§
impl Freeze for RetryConfig
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnwindSafe for RetryConfig
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