pub struct RetryOptions {
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: Durationinitial wait time before the first retry.
randomization_factor: f64randomization jitter that is used as a multiplier for the current retry interval and is added or subtracted from the interval length.
multiplier: f64rate at which retry time should be increased, until it reaches max_interval.
max_interval: Durationmaximum 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: usizemaximum number of retry attempts.
Implementations§
Source§impl RetryOptions
impl RetryOptions
Sourcepub const fn no_retries() -> Self
pub const fn no_retries() -> Self
A retry policy that never retires
Trait Implementations§
Source§impl Clone for RetryOptions
impl Clone for RetryOptions
Source§fn clone(&self) -> RetryOptions
fn clone(&self) -> RetryOptions
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 RetryOptions
impl Debug for RetryOptions
Source§impl Default for RetryOptions
impl Default for RetryOptions
Source§impl From<RetryOptions> for ExponentialBackoff
impl From<RetryOptions> for ExponentialBackoff
Source§fn from(c: RetryOptions) -> Self
fn from(c: RetryOptions) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RetryOptions
impl PartialEq for RetryOptions
impl StructuralPartialEq for RetryOptions
Auto Trait Implementations§
impl Freeze for RetryOptions
impl RefUnwindSafe for RetryOptions
impl Send for RetryOptions
impl Sync for RetryOptions
impl Unpin for RetryOptions
impl UnsafeUnpin for RetryOptions
impl UnwindSafe for RetryOptions
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