Skip to main content

PublicErrorKind

Enum PublicErrorKind 

Source
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§

Source§

impl PublicErrorKind

Source

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

Returns the stable ASCII identifier exposed by every transport.

Source

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

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

Source

pub const fn class(self) -> ErrorClass

Returns the protocol-neutral class for this failure.

Source

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.

Source

pub const fn recovery_action(self) -> RecoveryAction

Returns safe recovery guidance for this failure.

Trait Implementations§

Source§

impl Clone for PublicErrorKind

Source§

fn clone(&self) -> Self

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
Source§

impl Copy for PublicErrorKind

Source§

impl Debug for PublicErrorKind

Source§

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

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

impl Eq for PublicErrorKind

Source§

impl Hash for PublicErrorKind

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 PublicErrorKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.