pub enum HostDeliveryState {
Queued,
Leased {
lease: HostDeliveryLease,
},
DeliveredToHost {
receipt: HostActivationReceipt,
},
Acknowledged {
observation: HostDeliveryObservation,
},
Processed {
at: OffsetDateTime,
action: ProcessedActionRef,
},
Failed {
reason: DeliveryFailureReason,
attempt: DeliveryAttempt,
},
Expired {
at: OffsetDateTime,
cause: DeliveryExpiryCause,
},
Superseded {
by: Option<HostDeliveryId>,
},
}Expand description
Where one delivery has got to, and what it carries there.
Every state after the first names the thing that put it there — a lease, a receipt, an observation, a cause — so that reading the ledger answers “why” without going anywhere else. The transport facts live here and never in the sealed stream, which records what the ceremony decided rather than how the news travelled.
Variants§
Queued
Waiting for a host to be handed it.
Leased
Handed out exclusively until the lease expires.
Fields
lease: HostDeliveryLeaseDeliveredToHost
The activation adapter reached the host.
Fields
receipt: HostActivationReceiptAcknowledged
The host said what it saw.
Fields
observation: HostDeliveryObservationProcessed
The host acted, and said which act closed it.
Failed
Attempts ran out, and the failure stays visible.
Expired
It stopped being worth making.
Superseded
Its destination was replaced.
by names the delivery opened in its place, and is absent when
the work was told not to follow: a superseded delivery that
pointed at a record nobody opened would send an operator looking
for a hand-off that never happened.
Fields
by: Option<HostDeliveryId>Implementations§
Source§impl HostDeliveryState
impl HostDeliveryState
pub const fn kind(&self) -> HostDeliveryStateKind
pub const fn is_terminal(&self) -> bool
Sourcepub const fn lease(&self) -> Option<&HostDeliveryLease>
pub const fn lease(&self) -> Option<&HostDeliveryLease>
The lease this state holds, when it holds one.
Sourcepub const fn observation(&self) -> Option<&HostDeliveryObservation>
pub const fn observation(&self) -> Option<&HostDeliveryObservation>
What the host said, when it has said anything.
Sourcepub const fn superseded_by(&self) -> Option<&HostDeliveryId>
pub const fn superseded_by(&self) -> Option<&HostDeliveryId>
What replaced this delivery, when anything did.
Sourcepub const fn action(&self) -> Option<&ProcessedActionRef>
pub const fn action(&self) -> Option<&ProcessedActionRef>
The act that closed this delivery, when one has.
Sourcepub const fn failure_reason(&self) -> Option<&DeliveryFailureReason>
pub const fn failure_reason(&self) -> Option<&DeliveryFailureReason>
Why the last attempt did not work, when one did not.