Skip to main content

SigFirstSub

Struct SigFirstSub 

Source
pub struct SigFirstSub { /* private fields */ }
Expand description

Live sig-first subscription. Call SigFirstSub::next in a loop.

A background task drains the connection as fast as the network delivers. When a slow next loop fills the queue, the oldest items are evicted and counted by SigFirstSub::dropped. SigFirstSub::gaps is a separate, provisional counter for sequence numbers that appear not to have arrived (network loss, a shed delivery — or merely reordering, which it cannot tell apart), as opposed to dropped, which counts items that definitely arrived and were evicted because this consumer fell behind.

Implementations§

Source§

impl SigFirstSub

Source

pub async fn next(&mut self) -> Result<Option<SigFirstItem>>

Awaits the next SigFirstItem. A QUIC application close is returned as Error::ApplicationClosed, including normal close code 0; Ok(None) is reserved for a locally ended drain with no terminal error.

Do the work for each item elsewhere. Time spent between two calls is queue depth, and past SIG_QUEUE_LEN it is loss.

Source

pub fn dropped(&self) -> u64

Items evicted because this consumer fell behind. Watch it: no kernel or NIC counter will show this loss.

Source

pub fn gaps(&self) -> u64

A provisional loss indicator: item-to-item seq gaps plus trailing loss revealed by a heartbeat’s highest_seq. NO_SEQ_ASSIGNED on the wire never contributes to this counter.

It can over-report under reordering. QUIC DATAGRAMs are unordered by definition, so a scalar high-watermark cannot distinguish “this seq is late” from “this seq is lost” at the moment a later one arrives out of order — it charges one provisional gap on that jump, and never reverses the charge if the late item shows up afterward. A perfectly lossless but reordered stream can therefore report gaps() > 0. Treat this as “loss happened, or reordering did” rather than an exact count of sequence numbers that never arrived on the wire at all.

Source

pub async fn update_filter(&self, filter: &Filter) -> Result<Ack>

Updates the active filter live (opens a fresh control stream) and returns the server’s parsed ack. Enrichment fields do not exist on the sig-first tier, so this always sends an empty fields list. The tier cannot change after the first control message.

Trait Implementations§

Source§

impl Drop for SigFirstSub

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> 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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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