Skip to main content

ChannelDelivery

Struct ChannelDelivery 

Source
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

Source

pub const fn delivery_id(&self) -> Option<DeliveredId>

The exact live identity supplied by the publication’s transport.

Source

pub const fn delivered_count(&self) -> usize

Number of local subscribers the message was genuinely delivered to.

Source

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).

Source

pub const fn is_delivered(&self) -> bool

Whether the message was accepted by at least one subscriber.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ChannelDelivery

Source§

impl Debug for ChannelDelivery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ChannelDelivery

Source§

impl PartialEq for ChannelDelivery

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ChannelDelivery

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more