pub enum BackoffStrategy {
Fixed,
Linear {
multiplier: f64,
},
Exponential {
base: f64,
multiplier: f64,
},
Custom {
function_name: String,
},
}Expand description
Different backoff strategies for calculating retry delays.
Each strategy defines how the delay between retry attempts should increase. The actual delay is calculated based on the attempt number and the strategy’s parameters.
Variants§
Fixed
Fixed delay - same delay for every retry attempt
Linear
Linear backoff - delay increases linearly with each attempt delay = initial_delay * attempt * multiplier
Exponential
Exponential backoff - delay increases exponentially with each attempt delay = initial_delay * multiplier * (base ^ attempt)
Fields
Custom
Custom backoff function (reserved for future extensibility)
Trait Implementations§
Source§impl Clone for BackoffStrategy
impl Clone for BackoffStrategy
Source§fn clone(&self) -> BackoffStrategy
fn clone(&self) -> BackoffStrategy
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackoffStrategy
impl Debug for BackoffStrategy
Source§impl<'de> Deserialize<'de> for BackoffStrategy
impl<'de> Deserialize<'de> for BackoffStrategy
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
Source§impl PartialEq for BackoffStrategy
impl PartialEq for BackoffStrategy
Source§impl Serialize for BackoffStrategy
impl Serialize for BackoffStrategy
impl StructuralPartialEq for BackoffStrategy
Auto Trait Implementations§
impl Freeze for BackoffStrategy
impl RefUnwindSafe for BackoffStrategy
impl Send for BackoffStrategy
impl Sync for BackoffStrategy
impl Unpin for BackoffStrategy
impl UnwindSafe for BackoffStrategy
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)