pub struct ChannelDelivery { /* private fields */ }Expand description
Genuine delivery ack returned by ChannelHandle::publish_with_delivery.
Distinct from backpressure: it reports whether a published message was actually received by a subscriber, not whether it was admitted to the bus.
Copy is preserved from published liminal-rs 0.9.1. A1 added two fields;
the one that briefly cost Copy was signal: PressureSignal, which is four
usizes and now derives Copy itself (durable_position: Option<u64> and
pressure_config: ChannelPressureConfig were already Copy). Nothing about
this type wants move semantics, and taking Copy away from a published type
breaks callers silently — let a = delivery; use(delivery); simply stops
compiling.
Implementations§
Source§impl ChannelDelivery
impl ChannelDelivery
Sourcepub const fn delivery_id(&self) -> Option<DeliveredId>
pub const fn delivery_id(&self) -> Option<DeliveredId>
The exact live identity supplied by the publication’s transport.
Sourcepub const fn delivered_count(&self) -> usize
pub const fn delivered_count(&self) -> usize
Number of local subscribers the message was genuinely delivered to.
Sourcepub const fn matched_count(&self) -> usize
pub const fn matched_count(&self) -> usize
Number of local subscribers whose predicate matched the message, whether
or not their inbox took it. With Self::delivered_count it tells
“nobody was subscribed” (0 matched) from “subscribers were there and
none took it” (matched, 0 delivered). Zero when the publish was refused
before any fan-out (a durable watermark Reject).
Sourcepub const fn is_delivered(&self) -> bool
pub const fn is_delivered(&self) -> bool
Whether the message was accepted by at least one subscriber.
Sourcepub const fn durable_position(&self) -> Option<u64>
pub const fn durable_position(&self) -> Option<u64>
The store-assigned append sequence of this publish on a durable
channel, None on a memory channel.
This is the durable position G1 of
docs/design/wire-durability-gaps-20260831.md names: haematite’s
append assigns it, and before this field the caller discarded it, so
no client of a durable channel could ever learn where its publish
landed. Any resume/ack protocol needs exactly this value.
Assigned is not flushed: the position is real the moment the append returns, but the store flushes on graceful shutdown only (G4’s flush half), so a crash can still lose the tail. The position tells you WHERE the publish sits, not that it survives every failure mode.
Sourcepub const fn pressure(&self) -> &PressureSignal
pub const fn pressure(&self) -> &PressureSignal
The A1 backpressure signal for this publish
(docs/design/A1-DEFER-SEMANTICS.md §6: “ChannelDelivery gains a
pressure() accessor (additive)”).
Orthogonal to Self::is_delivered. Delivery answers “did a subscriber
receive it”; pressure answers “should you slow down”. A publish to a
channel with no subscribers is Accept and delivered to nobody; a
publish every consumer buffered is Defer and delivered to everybody.
Sourcepub const fn is_admitted(&self) -> bool
pub const fn is_admitted(&self) -> bool
Whether the bus took custody of the message (A1 §7): Accept or
Defer.
The accessor an aion worker’s fire-and-forget completion policy reads,
deliberately distinct from Self::is_delivered (“a subscriber
genuinely received it”). A Deferred message is admitted — the bus holds
it and the consumer’s next pop is its redelivery — so a producer that
re-publishes it with a fresh key double-delivers. false means Reject:
shed, delivered to nobody, and the producer owns the retry.
Sourcepub fn defer_delay(&self) -> Option<Duration>
pub fn defer_delay(&self) -> Option<Duration>
The producer’s advisory pacing hint (A1 §3):
base + (max − base) × buffer_fill_fraction, from this channel’s
configured delay policy. None on Accept — an accepted publish is not
paced.
The bus never blocks a producer on this and never lies about it: ignoring the hint leads to Reject on an ephemeral channel, and to growing hints and eventually the pre-append watermark Reject on a durable one.
Trait Implementations§
Source§impl Clone for ChannelDelivery
impl Clone for ChannelDelivery
impl Copy for ChannelDelivery
Source§impl Debug for ChannelDelivery
impl Debug for ChannelDelivery
impl Eq for ChannelDelivery
Source§impl PartialEq for ChannelDelivery
impl PartialEq for ChannelDelivery
impl StructuralPartialEq for ChannelDelivery
Auto Trait Implementations§
impl Freeze for ChannelDelivery
impl RefUnwindSafe for ChannelDelivery
impl Send for ChannelDelivery
impl Sync for ChannelDelivery
impl Unpin for ChannelDelivery
impl UnsafeUnpin for ChannelDelivery
impl UnwindSafe for ChannelDelivery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.