Skip to main content

ClientEvent

Enum ClientEvent 

Source
pub enum ClientEvent {
    Welcome(Box<VerifiedWelcome>),
    WelcomeRejected(WelcomeError),
    Response(Response),
    Retrying {
        request_id: RequestId,
        kind: &'static str,
        error: ErrorBody,
        retry_at_ms: u64,
    },
    GaveUp {
        request_id: RequestId,
        kind: &'static str,
    },
    Event(Box<ReceivedEvent>),
    Gap(Gap),
    ResyncRequired {
        stream: Stream,
        channel_id: Option<ChannelId>,
    },
    ProtocolError(ProtocolError),
}
Expand description

One outcome for the application.

Variants§

§

Welcome(Box<VerifiedWelcome>)

The welcome verified: commands may be sent (§6.2).

§

WelcomeRejected(WelcomeError)

The welcome failed verification; the session is dead and SHOULD alert the user.

§

Response(Response)

A final response to a command.

§

Retrying

A transient error (BUSY, RATE_LIMITED, SLOWMODE_ACTIVE, INTERNAL): the same request is resent at retry_at_ms (§7.3). For the session’s own sync.ack refused with RATE_LIMITED (kind "sync.ack", a request_id the application never saw) a new ack with the cursors current at retry_at_ms is sent instead (§10.5); nothing needs doing.

Fields

§request_id: RequestId

The request.

§kind: &'static str

Its command name.

§error: ErrorBody

The transient error.

§retry_at_ms: u64

When it is resent.

§

GaveUp

No response within the give-up time (24 h, §7.3); the request is abandoned.

Fields

§request_id: RequestId

The request.

§kind: &'static str

Its command name.

§

Event(Box<ReceivedEvent>)

A catalogue event applied in stream order (§9.4, §10).

§

Gap(Gap)

A sequence gap; the session has sent sync.resume to repair it (§10).

§

ResyncRequired

A stream is older than the host’s retention: take a snapshot (member stream) or page message.history (channel), then reset its cursor (§10.2).

Fields

§stream: Stream

The stream.

§channel_id: Option<ChannelId>

The channel, for a channel stream.

§

ProtocolError(ProtocolError)

Something was received and ignored safely.

Trait Implementations§

Source§

impl Clone for ClientEvent

Source§

fn clone(&self) -> ClientEvent

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 ClientEvent

Source§

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

Formats the value using the given formatter. 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> 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> 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 = 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.