Skip to main content

EventBusError

Enum EventBusError 

Source
pub enum EventBusError {
Show 14 variants NotStarted, StartFailed { message: String, }, InvalidArgument { field: &'static str, message: String, }, MissingField { field: &'static str, }, HandlerFailed { message: String, }, HandlerPanicked, InterceptorFailed { phase: &'static str, message: String, }, ErrorHandlerFailed { phase: &'static str, message: String, }, DeadLetterFailed { message: String, }, ExecutionRejected { message: String, }, ShutdownTimedOut { timeout: Duration, }, LockPoisoned { resource: &'static str, }, TypeMismatch { expected: &'static str, actual: &'static str, }, UnsupportedOperation { operation: &'static str, },
}
Expand description

Error returned by event bus configuration, publishing, or subscription work.

Variants§

§

NotStarted

Operation requires a started event bus.

§

StartFailed

The event bus could not be started.

Fields

§message: String

Human-readable startup failure reason.

§

InvalidArgument

An argument value is invalid.

Fields

§field: &'static str

Argument name.

§message: String

Human-readable validation message.

§

MissingField

A required builder field is missing.

Fields

§field: &'static str

Missing field name.

§

HandlerFailed

Subscriber handler failed.

Fields

§message: String

Human-readable failure message.

§

HandlerPanicked

Subscriber handler or interceptor panicked.

§

InterceptorFailed

A configured interceptor failed while processing an event.

Fields

§phase: &'static str

Interceptor phase.

§message: String

Human-readable failure message.

§

ErrorHandlerFailed

A configured error handler failed while processing another error.

Fields

§phase: &'static str

Error handling phase.

§message: String

Human-readable failure message.

§

DeadLetterFailed

Dead-letter routing failed after a terminal subscriber failure.

Fields

§message: String

Human-readable routing failure message.

§

ExecutionRejected

Managed executor rejected event processing work.

Fields

§message: String

Human-readable rejection reason.

§

ShutdownTimedOut

Graceful shutdown did not complete before the configured timeout.

Fields

§timeout: Duration

Timeout used for the shutdown wait.

§

LockPoisoned

Shared state lock was poisoned.

Fields

§resource: &'static str

Shared resource name.

§

TypeMismatch

A type-erased event or handler had an unexpected payload type.

Fields

§expected: &'static str

Expected Rust type name.

§actual: &'static str

Actual Rust type name.

§

UnsupportedOperation

Operation is not supported by this backend.

Fields

§operation: &'static str

Operation name or feature category.

Implementations§

Source§

impl EventBusError

Source

pub const fn not_started() -> Self

Creates EventBusError::NotStarted.

§Returns

Error indicating that the bus must be started first.

Source

pub fn start_failed(message: impl Into<String>) -> Self

Creates EventBusError::StartFailed.

§Parameters
  • message: Startup failure details.
§Returns

Startup error with context.

Source

pub fn invalid_argument(field: &'static str, message: impl Into<String>) -> Self

Creates EventBusError::InvalidArgument.

§Parameters
  • field: Argument name.
  • message: Validation message.
§Returns

Validation error with field context.

Source

pub const fn missing_field(field: &'static str) -> Self

Creates EventBusError::MissingField.

§Parameters
  • field: Missing builder field.
§Returns

Builder validation error.

Source

pub fn handler_failed(message: impl Into<String>) -> Self

Creates EventBusError::HandlerFailed.

§Parameters
  • message: Handler failure description.
§Returns

Handler failure error.

Source

pub const fn handler_panicked() -> Self

Creates EventBusError::HandlerPanicked.

§Returns

Handler panic error used by subscriber failure handling.

Source

pub fn interceptor_failed( phase: &'static str, message: impl Into<String>, ) -> Self

Creates EventBusError::InterceptorFailed.

§Parameters
  • phase: Interceptor phase.
  • message: Interceptor failure details.
§Returns

Interceptor failure with context.

Source

pub fn error_handler_failed( phase: &'static str, message: impl Into<String>, ) -> Self

Creates EventBusError::ErrorHandlerFailed.

§Parameters
  • phase: Error handling phase.
  • message: Handler failure details.
§Returns

Error handler failure with context.

Source

pub fn dead_letter_failed(message: impl Into<String>) -> Self

Creates EventBusError::DeadLetterFailed.

§Parameters
  • message: Dead-letter routing failure details.
§Returns

Dead-letter failure with context.

Source

pub fn execution_rejected(message: impl Into<String>) -> Self

Creates EventBusError::ExecutionRejected.

§Parameters
  • message: Executor rejection details.
§Returns

Rejection error with executor context.

Source

pub const fn shutdown_timed_out(timeout: Duration) -> Self

Creates EventBusError::ShutdownTimedOut.

§Parameters
  • timeout: Timeout that elapsed before shutdown completed.
§Returns

Shutdown timeout error with the configured duration.

Source

pub const fn lock_poisoned(resource: &'static str) -> Self

Creates EventBusError::LockPoisoned.

§Parameters
  • resource: Name of the poisoned shared state.
§Returns

Lock-poisoning error.

Source

pub const fn type_mismatch(expected: &'static str, actual: &'static str) -> Self

Creates EventBusError::TypeMismatch.

§Parameters
  • expected: Expected type name.
  • actual: Actual type name.
§Returns

Type-erasure mismatch error.

Source

pub const fn unsupported_operation(operation: &'static str) -> Self

Creates EventBusError::UnsupportedOperation.

§Parameters
  • operation: Operation name or feature category.
§Returns

Error indicating that the current backend does not support the operation.

Source

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

Returns a stable symbolic error kind.

§Returns

Static string useful for diagnostics and dead-letter metadata.

Trait Implementations§

Source§

impl Clone for EventBusError

Source§

fn clone(&self) -> EventBusError

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 Debug for EventBusError

Source§

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

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

impl Display for EventBusError

Source§

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

Formats the error for logs and assertions.

Source§

impl Error for EventBusError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + '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
Source§

impl PartialEq for EventBusError

Source§

fn eq(&self, other: &EventBusError) -> 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.
Source§

impl Eq for EventBusError

Source§

impl StructuralPartialEq for EventBusError

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<E> IntoBoxError for E
where E: Error + Send + Sync + 'static,

Source§

fn into_box_error(self) -> Box<dyn Error + Sync + Send>

Converts this error into a boxed dynamic error. Read more
Source§

impl<T> IntoResult<T> for T

Source§

impl<T> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Converts this argument into the default value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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, 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.