pub struct RetryStrategy { /* private fields */ }Expand description
Struct representing the retry strategy for sending data.
This struct contains the parameters that define how retries should be handled when sending data. It includes the maximum number of retries, the delay between retries, the type of backoff to use, and an optional jitter to add randomness to the delay.
Implementations§
Source§impl RetryStrategy
impl RetryStrategy
Sourcepub fn new(
max_retries: u32,
delay_ms: u64,
backoff_type: RetryBackoffType,
jitter: Option<u64>,
) -> RetryStrategy
pub fn new( max_retries: u32, delay_ms: u64, backoff_type: RetryBackoffType, jitter: Option<u64>, ) -> RetryStrategy
Creates a new RetryStrategy with the specified parameters.
§Arguments
max_retries: The maximum number of retries to attempt.delay_ms: The minimum delay between retries, in milliseconds.backoff_type: The type of backoff to use for the delay between retries.jitter: An optional jitter to add randomness to the delay, in milliseconds.
§Returns
A RetryStrategy instance with the specified parameters.
§Examples
use libdd_trace_utils::send_with_retry::{RetryBackoffType, RetryStrategy};
use std::time::Duration;
let retry_strategy = RetryStrategy::new(5, 100, RetryBackoffType::Exponential, Some(50));Trait Implementations§
Source§impl Clone for RetryStrategy
impl Clone for RetryStrategy
Source§fn clone(&self) -> RetryStrategy
fn clone(&self) -> RetryStrategy
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 RetryStrategy
impl Debug for RetryStrategy
Auto Trait Implementations§
impl Freeze for RetryStrategy
impl RefUnwindSafe for RetryStrategy
impl Send for RetryStrategy
impl Sync for RetryStrategy
impl Unpin for RetryStrategy
impl UnsafeUnpin for RetryStrategy
impl UnwindSafe for RetryStrategy
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