pub enum RetryMechanism {
Exponential {
base_delay: Duration,
max_delay: Duration,
},
Linear {
delay: Duration,
},
Custom {
delays: Vec<Duration>,
},
}Expand description
Retry mechanism configuration
Variants§
Exponential
Exponential backoff: base_delay * 2^attempt, capped at max_delay Example: 1s -> 2s -> 4s -> 8s -> 16s (capped at max_delay)
Linear
Linear delay: same delay for each retry attempt Example: 5s -> 5s -> 5s -> 5s
Custom
Custom delays: specify exact delay for each retry attempt Example: [1s, 5s, 30s] for 3 retries with increasing delays
Trait Implementations§
Source§impl Clone for RetryMechanism
impl Clone for RetryMechanism
Source§fn clone(&self) -> RetryMechanism
fn clone(&self) -> RetryMechanism
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 RetryMechanism
impl Debug for RetryMechanism
Source§impl<'de> Deserialize<'de> for RetryMechanism
impl<'de> Deserialize<'de> for RetryMechanism
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
Auto Trait Implementations§
impl Freeze for RetryMechanism
impl RefUnwindSafe for RetryMechanism
impl Send for RetryMechanism
impl Sync for RetryMechanism
impl Unpin for RetryMechanism
impl UnwindSafe for RetryMechanism
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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