pub struct RetryPolicy {
pub max_retries: u32,
pub initial_backoff_ms: u64,
pub backoff_multiplier: u32,
pub backoff_cap_ms: u64,
}Expand description
Bounded retry envelope for settlement routing.
Fields§
§max_retries: u32Maximum number of retries before the failure is dead-lettered.
0 means the original call is the only attempt.
initial_backoff_ms: u64Initial backoff applied between attempt 0 and attempt 1.
backoff_multiplier: u32Multiplier on the previous backoff when computing the next.
backoff_cap_ms: u64Hard cap on a single backoff interval, in milliseconds.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub const fn validate(&self) -> Result<(), RetryPolicyError>
pub const fn validate(&self) -> Result<(), RetryPolicyError>
Validate the bounded retry envelope.
Sourcepub fn backoff_for(&self, attempt: u32) -> Duration
pub fn backoff_for(&self, attempt: u32) -> Duration
Compute the backoff applied before the attempt-th retry.
attempt = 0 returns the configured initial backoff.
Caps at Self::backoff_cap_ms.
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 moreimpl Copy for RetryPolicy
Source§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§impl<'de> Deserialize<'de> for RetryPolicy
impl<'de> Deserialize<'de> for RetryPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
Source§impl Serialize for RetryPolicy
impl Serialize 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