Skip to main content

RetryReason

Enum RetryReason 

Source
#[non_exhaustive]
pub enum RetryReason {
Show 17 variants KvNotMyVbucket, KvInvalidVbucketMap, KvTemporaryFailure, KvCollectionOutdated, KvErrorMapRetryIndicated, KvLocked, KvSyncWriteInProgress, KvSyncWriteRecommitInProgress, ServiceNotAvailable, SocketClosedWhileInFlight, SocketNotAvailable, QueryPreparedStatementFailure, QueryIndexNotFound, SearchTooManyRequests, HttpSendRequestFailed, HttpConnectFailed, NotReady,
}
Expand description

The reason an operation is being retried.

Each variant identifies a specific transient failure condition that triggered a retry. The SDK passes this to RetryStrategy::retry_after so the strategy can decide whether (and how long) to wait before retrying.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

KvNotMyVbucket

The server indicated the vBucket is not owned by this node.

§

KvInvalidVbucketMap

The vBucket map is invalid and must be refreshed.

§

KvTemporaryFailure

A temporary failure occurred on the KV engine.

§

KvCollectionOutdated

The collection ID is outdated and must be re-resolved.

§

KvErrorMapRetryIndicated

The server error map indicated the operation should be retried.

§

KvLocked

The document is locked by another operation.

§

KvSyncWriteInProgress

A sync-write (durable operation) is already in progress on this key.

§

KvSyncWriteRecommitInProgress

A sync-write recommit is in progress on this key.

§

ServiceNotAvailable

The required service is temporarily unavailable.

§

SocketClosedWhileInFlight

The connection was closed while the request was in flight.

§

SocketNotAvailable

No connection is currently available.

§

QueryPreparedStatementFailure

A prepared statement for the query was invalidated.

§

QueryIndexNotFound

The query index was not found (may still be building).

§

SearchTooManyRequests

The search service is rejecting requests due to rate limiting.

§

HttpSendRequestFailed

An HTTP request failed to send.

§

HttpConnectFailed

An HTTP connection failed to be established.

§

NotReady

The SDK is not yet ready to perform the operation.

Implementations§

Source§

impl RetryReason

Source

pub fn allows_non_idempotent_retry(&self) -> bool

Returns true if this reason allows retrying non-idempotent operations.

Most retry reasons are safe for non-idempotent retries because the server never processed the original request.

Source

pub fn always_retry(&self) -> bool

Returns true if the SDK should always retry for this reason, regardless of the retry strategy’s decision.

Trait Implementations§

Source§

impl Clone for RetryReason

Source§

fn clone(&self) -> RetryReason

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RetryReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RetryReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for RetryReason

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RetryReason

Source§

fn eq(&self, other: &RetryReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for RetryReason

Source§

impl Eq for RetryReason

Source§

impl StructuralPartialEq for RetryReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more