Skip to main content

PublicErrorKind

Enum PublicErrorKind 

pub enum PublicErrorKind {
Show 14 variants Validation, IdempotencyKeyReuse, AuthorizationDenied, ConcurrencyDeadlineExceeded, ContractMismatch, StorageUnavailable, OutcomeUnknown, InternalDefect, CommandExecutionFailed, HistoryIncarnationMismatch, HistoryPruned, Overloaded, FollowerMode, PrimaryFenced,
}
Expand description

The closed set of failures that RiffDB may expose to an untrusted caller.

Variants§

§

Validation

A request failed bounded validation.

§

IdempotencyKeyReuse

An idempotency identity was reused with different canonical input.

§

AuthorizationDenied

Authorization denied the operation.

§

ConcurrencyDeadlineExceeded

Logical conflict acquisition exceeded its deadline, or the fixed v1 command reevaluation budget was exhausted.

§

ContractMismatch

The requested contract version or plan is not current.

§

StorageUnavailable

Authoritative storage is temporarily unavailable.

§

OutcomeUnknown

A submitted command may have completed, but its outcome is not known.

§

InternalDefect

An internal defect occurred and details were retained only internally.

§

CommandExecutionFailed

Deterministic evaluation failed before an application commit was formed.

§

HistoryIncarnationMismatch

Observed history predates a database restore.

§

HistoryPruned

Requested history was retired by retention prune.

§

Overloaded

The service is over capacity and rejected admission.

§

FollowerMode

This node is a follower and cannot execute a write operation.

§

PrimaryFenced

Durable source fencing permanently refuses new command admission.

Implementations§

§

impl PublicErrorKind

pub const fn code(self) -> &'static str

Returns the stable ASCII identifier exposed by every transport.

pub const fn safe_message(self) -> &'static str

Returns the stable, caller-safe ASCII message for this failure.

pub const fn class(self) -> ErrorClass

Returns the protocol-neutral class for this failure.

pub const fn status_code(self) -> PublicErrorStatusCode

Returns the one authoritative public status code for this kind.

Server encoding and client validation must both use this mapping. Do not re-derive the wire code from Self::class alone: some kinds deliberately diverge (for example, overload keeps class ErrorClass::Unavailable while carrying [PublicErrorStatusCode::ResourceExhausted]).

This match is the sole wire-code authority and must remain exhaustive over every PublicErrorKind variant.

pub const fn recovery_action(self) -> RecoveryAction

Returns safe recovery guidance for this failure.

Trait Implementations§

§

impl Clone for PublicErrorKind

§

fn clone(&self) -> PublicErrorKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
§

impl Copy for PublicErrorKind

§

impl Debug for PublicErrorKind

§

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

Formats the value using the given formatter. Read more
§

impl Eq for PublicErrorKind

§

impl Hash for PublicErrorKind

§

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

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
§

impl PartialEq for PublicErrorKind

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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.
§

impl StructuralPartialEq for PublicErrorKind

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
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, 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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