pub struct RetryPolicy { /* private fields */ }Expand description
Overrides Dex retry timing for a Flow, wait_for, or execute operation.
Unset fields use server defaults. Intervals and total duration use Duration; maximum
attempts counts the initial attempt. A zero maximum attempts value uses the server behavior.
§Examples
use dex_sdk::RetryPolicy;
use std::time::Duration;
let retry = RetryPolicy::new()
.initial_interval(Duration::from_secs(1))
.backoff_coefficient(2.0)
.maximum_interval(Duration::from_secs(30))
.maximum_attempts(5);Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn initial_interval(self, value: Duration) -> Self
pub fn initial_interval(self, value: Duration) -> Self
Sets the delay before the first retry.
Sourcepub fn backoff_coefficient(self, value: f64) -> Self
pub fn backoff_coefficient(self, value: f64) -> Self
Sets the multiplier applied to each successive retry interval.
Sourcepub fn maximum_interval(self, value: Duration) -> Self
pub fn maximum_interval(self, value: Duration) -> Self
Caps the delay between retries.
Sourcepub fn maximum_attempts(self, value: u32) -> Self
pub fn maximum_attempts(self, value: u32) -> Self
Sets the total attempt limit, including the initial attempt.
Sourcepub fn total_duration(self, value: Duration) -> Self
pub fn total_duration(self, value: Duration) -> Self
Sets the total elapsed-time limit for all attempts.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§fn default() -> RetryPolicy
fn default() -> RetryPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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