made_core/ports/
delivery_failure_outcome.rs1use crate::value_objects::HostDeliveryRecord;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum DeliveryFailureOutcome {
6 Requeued(HostDeliveryRecord),
8 Exhausted(HostDeliveryRecord),
10 LeaseNotOwned,
12}
13
14impl DeliveryFailureOutcome {
15 #[must_use]
16 pub const fn record(&self) -> Option<&HostDeliveryRecord> {
17 match self {
18 Self::Requeued(record) | Self::Exhausted(record) => Some(record),
19 Self::LeaseNotOwned => None,
20 }
21 }
22
23 #[must_use]
24 pub const fn is_exhausted(&self) -> bool {
25 matches!(self, Self::Exhausted(_))
26 }
27}