outbox_core/dlq/model.rs
1use crate::object::EventId;
2
3/// One entry tracked by [`DlqHeap`]: an event id together with its current
4/// aggregated failure count.
5///
6/// The struct is `#[non_exhaustive]`: future revisions may add fields like
7/// `last_failed_at` or `last_error` without breaking downstream callers.
8#[non_exhaustive]
9#[derive(Debug, Clone)]
10pub struct DlqEntry {
11 pub id: EventId,
12 pub failure_count: u32,
13 pub last_error: Option<String>,
14}
15
16impl DlqEntry {
17 #[must_use]
18 pub fn new(id: EventId, failure_count: u32, last_error: Option<String>) -> Self {
19 Self {
20 id,
21 failure_count,
22 last_error,
23 }
24 }
25}