Skip to main content

Outbound

Enum Outbound 

Source
pub enum Outbound<'a> {
    Reply {
        id: u64,
        result: Result<Payload, RpcError>,
    },
    Event {
        sub: &'a str,
        seq: u64,
        topic: Option<&'a str>,
        data: Payload,
    },
    Snapshot {
        sub: &'a str,
        seq: u64,
        last: bool,
        topic: &'a str,
        data: Payload,
    },
    Subscribed {
        sub: &'a str,
    },
    Pong,
}
Expand description

A logical message sent back over a Connection (what the server emits).

Variants§

§

Reply

Reply to an Inbound::Request.

Fields

§id: u64

Correlation id of the originating request.

§result: Result<Payload, RpcError>

The result, or an RpcError.

§

Event

A subscription update.

Fields

§sub: &'a str

Subscription id this event belongs to.

§seq: u64

Monotonic sequence number.

§topic: Option<&'a str>

Concrete record topic that fired, when the subscription tags it (wildcard subscriptions fan in many records — see SubUpdate).

§data: Payload

Unparsed record value.

§

Snapshot

An initial snapshot emitted when a subscription opens (late-join).

Fields

§sub: &'a str

Subscription id the snapshot belongs to, so the client demux routes it like an Event (a wildcard subscription’s snapshots carry topics that don’t string-match the pattern key).

§seq: u64

Monotonic sequence number, in the same space as this subscription’s Events: the burst is numbered 1..=N and the first event continues at N + 1, so a lost snapshot surfaces in the next update’s SubUpdate::skipped.

§last: bool

Set on the last snapshot of the burst, so the loss total lands on an update the subscriber is guaranteed to see. The client engine reserves a sink slot for this frame.

§topic: &'a str

Topic the snapshot is for.

§data: Payload

Unparsed record value.

§

Subscribed

An explicit acknowledgement that a subscription opened. Emitted by run_session only when SessionConfig::acks_subscribe is set. The sub is the subscription’s routing id — the same value that tags its Events.

Fields

§sub: &'a str

Subscription id that was opened.

§

Pong

Keepalive response.

Auto Trait Implementations§

§

impl<'a> Freeze for Outbound<'a>

§

impl<'a> RefUnwindSafe for Outbound<'a>

§

impl<'a> Send for Outbound<'a>

§

impl<'a> Sync for Outbound<'a>

§

impl<'a> Unpin for Outbound<'a>

§

impl<'a> UnsafeUnpin for Outbound<'a>

§

impl<'a> UnwindSafe for Outbound<'a>

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, 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 = !

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.