Skip to main content

StoreError

Struct StoreError 

Source
pub struct StoreError { /* private fields */ }
Expand description

Canonical storage failure shared by the capability and implementation layers.

Stable identity and policy come exclusively from the catalog descriptor. Operation and component are typed diagnostic context. Private detail and a typed source are retained for local diagnosis, but their values are never formatted by this facade or exposed through its public view.

Implementations§

Source§

impl StoreError

Source

pub fn new( descriptor: &'static ErrorDescriptor, operation: StoreOperation, ) -> Self

Creates a storage error with catalog-owned identity.

Callers select one of the twelve STORAGE_* descriptors exported by rocketmq-error; runtime detail must never select or override identity.

§Panics

Panics when descriptor is not one of the twelve canonical storage descriptors. This is a programmer contract: runtime failures select a reviewed storage identity before constructing the facade.

Source

pub fn try_new( descriptor: &'static ErrorDescriptor, operation: StoreOperation, ) -> Option<Self>

Attempts to create a storage error with a validated catalog identity.

Returns None when descriptor belongs to another error domain. The facade never accepts caller-provided context, so successful construction also guarantees that only the four storage context fields can be emitted.

Source

pub fn in_component(self, component: StoreComponent) -> Self

Adds the closed component classification as diagnostic context.

Source

pub fn with_detail(self, detail: impl Into<String>) -> Self

Retains sensitive diagnostic detail without exposing its value.

Source

pub fn with_source(self, source: impl StdError + Send + Sync + 'static) -> Self

Preserves a typed cause in the standard source chain.

Source

pub fn with_boxed_source(self, source: Box<dyn StdError + Send + Sync>) -> Self

Preserves an already boxed typed cause in the standard source chain.

Source

pub const fn descriptor(&self) -> &'static ErrorDescriptor

Returns the immutable catalog descriptor that owns this error’s identity.

Source

pub const fn code(&self) -> ErrorCode

Returns the stable dotted catalog code.

Source

pub const fn condition(&self) -> CanonicalCondition

Returns the protocol-independent condition.

Source

pub const fn severity(&self) -> ErrorSeverity

Returns the catalog-owned severity.

Source

pub const fn recovery_hint(&self) -> RecoveryHint

Returns the catalog-owned recovery hint.

Source

pub const fn operation(&self) -> StoreOperation

Returns the operation that failed.

Source

pub const fn component(&self) -> StoreComponent

Returns the component that failed.

Source

pub const fn context(&self) -> &ErrorContext

Returns the bounded context retained by the canonical error.

Source

pub const fn location(&self) -> &'static Location<'static>

Returns the first-promotion caller location.

Source

pub const fn backtrace(&self) -> Option<&Backtrace>

Returns the catalog-controlled captured backtrace, when enabled.

Source

pub fn public_view(&self) -> Result<PublicErrorView<'_>, ViewContextViolation>

Creates the descriptor-validated public projection.

§Errors

Returns a schema violation if the catalog and the internally generated storage context become inconsistent.

Source

pub fn diagnostic_view( &self, ) -> Result<DiagnosticView<'_>, ViewContextViolation>

Creates the descriptor-validated controlled diagnostic projection.

§Errors

Returns a schema violation if the catalog and the internally generated storage context become inconsistent.

Trait Implementations§

Source§

impl Debug for StoreError

Source§

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

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

impl Display for StoreError

Source§

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

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

impl Error for StoreError

Source§

fn source(&self) -> Option<&(dyn StdError + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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> 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> 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, 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.