pub struct ProjectionRetryPolicy { /* private fields */ }Expand description
Controls retry behavior after an application requests a retry.
Implementations§
Source§impl ProjectionRetryPolicy
impl ProjectionRetryPolicy
Sourcepub fn new(
max_retries: u32,
initial_delay: Duration,
multiplier: f64,
maximum_delay: Duration,
) -> Result<Self, ProjectionConfigurationError>
pub fn new( max_retries: u32, initial_delay: Duration, multiplier: f64, maximum_delay: Duration, ) -> Result<Self, ProjectionConfigurationError>
Creates a capped exponential retry policy.
max_retries counts retries after the initial application attempt. u32::MAX is
rejected with ProjectionConfigurationError::TooManyRetries because the runner must
represent that initial attempt as well. multiplier must be finite and at least 1.0;
non-finite values and values below 1.0 produce
ProjectionConfigurationError::InvalidRetryMultiplier.
The delay before retry number n is initial_delay * multiplier^(n - 1), capped at
maximum_delay. A calculation that exceeds the representable finite duration also uses
the cap. Zero is accepted for either delay, including a policy with no delay at all.
Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Returns the number of retries after the initial attempt.
Sourcepub fn initial_delay(&self) -> Duration
pub fn initial_delay(&self) -> Duration
Returns the delay before the first retry.
Sourcepub fn multiplier(&self) -> f64
pub fn multiplier(&self) -> f64
Returns the multiplier used to increase retry delays.
Sourcepub fn maximum_delay(&self) -> Duration
pub fn maximum_delay(&self) -> Duration
Returns the maximum retry delay.
Trait Implementations§
Source§impl Clone for ProjectionRetryPolicy
impl Clone for ProjectionRetryPolicy
Source§fn clone(&self) -> ProjectionRetryPolicy
fn clone(&self) -> ProjectionRetryPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectionRetryPolicy
impl Debug for ProjectionRetryPolicy
Source§impl PartialEq for ProjectionRetryPolicy
impl PartialEq for ProjectionRetryPolicy
impl StructuralPartialEq for ProjectionRetryPolicy
Auto Trait Implementations§
impl Freeze for ProjectionRetryPolicy
impl RefUnwindSafe for ProjectionRetryPolicy
impl Send for ProjectionRetryPolicy
impl Sync for ProjectionRetryPolicy
impl Unpin for ProjectionRetryPolicy
impl UnsafeUnpin for ProjectionRetryPolicy
impl UnwindSafe for ProjectionRetryPolicy
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
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> 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> ⓘ
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> ⓘ
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 more