use crate::value_objects::HostDeliveryRecord;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DeliveryFailureOutcome {
Requeued(HostDeliveryRecord),
Exhausted(HostDeliveryRecord),
LeaseNotOwned,
}
impl DeliveryFailureOutcome {
#[must_use]
pub const fn record(&self) -> Option<&HostDeliveryRecord> {
match self {
Self::Requeued(record) | Self::Exhausted(record) => Some(record),
Self::LeaseNotOwned => None,
}
}
#[must_use]
pub const fn is_exhausted(&self) -> bool {
matches!(self, Self::Exhausted(_))
}
}