pub struct TransientPolicy<P> {
pub is_transient: P,
pub max_retries: usize,
}Expand description
Which probe failures are transient, and how many re-probes they may buy.
The default classification is is_retryable_conflict. Override it to add
error types of your own that describe contention — an optimistic-concurrency
conflict, say — so the search re-probes their ranges too.
Fields§
§is_transient: PReturns true when a probe failure carries no information about the
range’s contents.
max_retries: usizeHow many transient re-probes the whole search may take before it is abandoned.
Implementations§
Source§impl<P> TransientPolicy<P>
impl<P> TransientPolicy<P>
Sourcepub fn with_max_retries(self, max_retries: usize) -> Self
pub fn with_max_retries(self, max_retries: usize) -> Self
Overrides the retry allowance.
Trait Implementations§
Source§impl<P: Clone> Clone for TransientPolicy<P>
impl<P: Clone> Clone for TransientPolicy<P>
Source§fn clone(&self) -> TransientPolicy<P>
fn clone(&self) -> TransientPolicy<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<P: Copy> Copy for TransientPolicy<P>
Auto Trait Implementations§
impl<P> Freeze for TransientPolicy<P>where
P: Freeze,
impl<P> RefUnwindSafe for TransientPolicy<P>where
P: RefUnwindSafe,
impl<P> Send for TransientPolicy<P>where
P: Send,
impl<P> Sync for TransientPolicy<P>where
P: Sync,
impl<P> Unpin for TransientPolicy<P>where
P: Unpin,
impl<P> UnsafeUnpin for TransientPolicy<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for TransientPolicy<P>where
P: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more