pub struct BackoffLimit<S, const LIMIT: usize> { /* private fields */ }Expand description
Wraps a BackoffStrategy to make it a BoundedBackoffStrategy completing after LIMIT
iterations.
Implementations§
Source§impl<S: BackoffStrategy, const LIMIT: usize> BackoffLimit<S, LIMIT>
impl<S: BackoffStrategy, const LIMIT: usize> BackoffLimit<S, LIMIT>
Trait Implementations§
Source§impl<S: BackoffStrategy, const LIMIT: usize> BackoffStrategy for BackoffLimit<S, LIMIT>
impl<S: BackoffStrategy, const LIMIT: usize> BackoffStrategy for BackoffLimit<S, LIMIT>
Source§fn backoff(&mut self) -> RetryStrategy
fn backoff(&mut self) -> RetryStrategy
Performs backoff and returns how the CAS should be retried. Read more
Source§fn will_reload(&self) -> bool
fn will_reload(&self) -> bool
Source§fn backoff_reload<T: PartialEq, F: FnMut() -> T>(
&mut self,
current: T,
reload: F,
) -> T
fn backoff_reload<T: PartialEq, F: FnMut() -> T>( &mut self, current: T, reload: F, ) -> T
Performs backoff after a failed CAS and reloads the atomic value according to the returned
RetryStrategy. Read moreSource§fn backoff_until<C: BackoffUntilCondition, F: FnMut() -> C>(
&mut self,
f: F,
) -> C::Result
fn backoff_until<C: BackoffUntilCondition, F: FnMut() -> C>( &mut self, f: F, ) -> C::Result
Loops until a condition is satisfied, performing backoff at each iteration.
Source§impl<S: BackoffStrategy, const LIMIT: usize> BoundedBackoffStrategy for BackoffLimit<S, LIMIT>
impl<S: BackoffStrategy, const LIMIT: usize> BoundedBackoffStrategy for BackoffLimit<S, LIMIT>
Source§fn is_completed(&self) -> bool
fn is_completed(&self) -> bool
Returns
true if the bounded number of iterations has been reached. Read moreSource§fn try_backoff_until<C: BackoffUntilCondition, F: FnMut() -> C>(
&mut self,
f: F,
) -> Option<C::Result>
fn try_backoff_until<C: BackoffUntilCondition, F: FnMut() -> C>( &mut self, f: F, ) -> Option<C::Result>
Loops until a condition is satisfied or the backoff is completed, performing backoff at
each iteration. Read more
Auto Trait Implementations§
impl<S, const LIMIT: usize> Freeze for BackoffLimit<S, LIMIT>where
S: Freeze,
impl<S, const LIMIT: usize> RefUnwindSafe for BackoffLimit<S, LIMIT>where
S: RefUnwindSafe,
impl<S, const LIMIT: usize> Send for BackoffLimit<S, LIMIT>where
S: Send,
impl<S, const LIMIT: usize> Sync for BackoffLimit<S, LIMIT>where
S: Sync,
impl<S, const LIMIT: usize> Unpin for BackoffLimit<S, LIMIT>where
S: Unpin,
impl<S, const LIMIT: usize> UnsafeUnpin for BackoffLimit<S, LIMIT>where
S: UnsafeUnpin,
impl<S, const LIMIT: usize> UnwindSafe for BackoffLimit<S, LIMIT>where
S: UnwindSafe,
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