pub struct DeadLetter {
pub event_name: &'static str,
pub subscription_id: SubscriptionId,
pub attempts: usize,
pub error: String,
pub event: Arc<dyn Any + Send + Sync>,
pub failed_at: SystemTime,
pub listener_name: Option<&'static str>,
}Expand description
A dead-letter record emitted when a handler exhausts all retry attempts.
The original error is stored as a String rather than a typed error
because DeadLetter must be Clone (it is published as an event) and
Box<dyn Error> does not implement Clone. Use error
for diagnostics or pattern-match on the stringified message.
The original event payload is available via event as a
type-erased Arc. Consumers can call
dead_letter.event.downcast_ref::<OriginalEvent>() to inspect the
payload that caused the failure.
Fields§
§event_name: &'static strThe type_name of the event that failed.
subscription_id: SubscriptionIdThe subscription that failed to handle the event.
attempts: usizeTotal number of attempts (initial + retries).
error: StringStringified error from the last failed attempt.
event: Arc<dyn Any + Send + Sync>The original event payload, type-erased.
Use downcast_ref::<E>() to recover the concrete event type.
failed_at: SystemTimeWhen the terminal failure occurred.
listener_name: Option<&'static str>Human-readable name of the listener that failed, if provided.
Trait Implementations§
Source§impl Clone for DeadLetter
impl Clone for DeadLetter
Source§fn clone(&self) -> DeadLetter
fn clone(&self) -> DeadLetter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more