pub struct RetryPolicy { /* private fields */ }Expand description
Retry policy with maximum retry limits
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn new(strategy: RetryStrategy, max_retries: u32) -> Self
pub fn new(strategy: RetryStrategy, max_retries: u32) -> Self
Create a new retry policy
Sourcepub fn with_retry_on_timeout(self, retry: bool) -> Self
pub fn with_retry_on_timeout(self, retry: bool) -> Self
Set whether to retry on timeout errors
Sourcepub fn with_retry_on_rate_limit(self, retry: bool) -> Self
pub fn with_retry_on_rate_limit(self, retry: bool) -> Self
Set whether to retry on rate limit errors
Sourcepub fn should_retry(&self, message: &Message) -> bool
pub fn should_retry(&self, message: &Message) -> bool
Check if a message should be retried
Sourcepub fn next_retry_eta(&self, message: &Message) -> Option<DateTime<Utc>>
pub fn next_retry_eta(&self, message: &Message) -> Option<DateTime<Utc>>
Calculate the next ETA for a retry
Sourcepub fn create_retry_message(&self, message: &Message) -> Option<Message>
pub fn create_retry_message(&self, message: &Message) -> Option<Message>
Create a retry message with updated retry count and ETA
Sourcepub fn strategy(&self) -> &RetryStrategy
pub fn strategy(&self) -> &RetryStrategy
Get the retry strategy
Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Get the maximum number of retries
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 · 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 RetryPolicy
impl Debug 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 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