Skip to main content

RecordUpdate

Struct RecordUpdate 

Source
pub struct RecordUpdate {
    pub topic: Option<String>,
    pub value: Option<Value>,
    pub skipped: u64,
    pub snapshot_end: bool,
}
Expand description

One update from a subscription: the record value, plus the delivery metadata the engine tracks alongside it.

One inbound frame yields exactly one of these, so skipped and snapshot_end always describe the frame they arrive on.

Fields§

§topic: Option<String>

Concrete record that fired. Some on wildcard subscriptions, which fan in many records under one subscription; None when the server left the event untagged (exact-topic subscribe).

§value: Option<Value>

The decoded record value, or None if the payload did not decode — a malformed peer, since the server serializes record values as JSON.

An undecodable frame is still delivered, so that skipped and snapshot_end stay attached to the frame they describe, and so one bad record cannot end a wildcard stream that fans in many.

§skipped: u64

Updates lost between the previous delivered update and this one — 0 when delivery was lossless. Non-zero means the server-side buffer overran a slow consumer, so the value stream has a hole immediately before this item.

§snapshot_end: bool

Final update of a late-join snapshot burst: every update after it is a live event. A burst that overran the sink carries its whole loss in skipped here — the engine reserves a slot for this update, so an overrun cannot cost you the marker.

Its absence is not a signal, and must never be waited on. The marker rides the last snapshot’s frame, so a burst that produced none never sets it: nothing matched, nothing has a value yet, an exact-topic subscribe, or a tail that failed to encode. Only the last of those is a real loss, and skipped reports it.

Implementations§

Source§

impl RecordUpdate

Source

pub fn has_gap(&self) -> bool

Whether updates were lost immediately before this one.

Trait Implementations§

Source§

impl Clone for RecordUpdate

Source§

fn clone(&self) -> RecordUpdate

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 Debug for RecordUpdate

Source§

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

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

impl PartialEq for RecordUpdate

Source§

fn eq(&self, other: &RecordUpdate) -> 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 RecordUpdate

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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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