pub struct TransientPolicy<P> {
pub is_transient: P,
pub max_retries: usize,
}Expand description
Which probe failures are contention — not attributable to the range’s contents — and how many re-probes they may buy.
The default classification is [is_contention]: a deadlock victim or a
serialization failure, recognised anywhere in the error’s source chain.
Override it for error types of your own that describe the same thing: a
failure that says nothing about the items, only about the interleaving.
Other transients are left to the search on purpose. An
optimistic-concurrency conflict names one stale item, so splitting
isolates it where re-probing the same range would only conflict again; a
lost connection cannot be re-probed at all, and surfaces as the helper’s
outer Err on the next savepoint instead.
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>
impl<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
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> ⓘ
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> ⓘ
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