Skip to main content

ServerMsg

Enum ServerMsg 

Source
pub enum ServerMsg {
    Challenge {
        nonce_b64: String,
    },
    Ready {
        fingerprint: String,
    },
    Message {
        room: String,
        id: String,
        payload_b64: String,
        mailbox_id: Option<i64>,
        seq: Option<i64>,
    },
    Sent {
        id: String,
        delivered: usize,
        queued: usize,
    },
    ConnectToken {
        token: String,
        ttl_secs: u64,
    },
    ConnectTokenResolved {
        token: String,
        fingerprint: Option<String>,
        pubkey_b64: Option<String>,
    },
    Pong,
    Error {
        message: String,
    },
}
Expand description

Relay → client. The relay serializes these; the client deserializes them.

Variants§

§

Challenge

huddle 1.1.4: sent immediately on connect. The client signs the nonce to prove control of its identity key before it can do anything.

Fields

§nonce_b64: String
§

Ready

Sent after a successful Hello. Carries the authenticated fingerprint (the client already knows its own identity, so it ignores the field).

Fields

§fingerprint: String
§

Message

A room message delivered live or from the offline mailbox. huddle 2.0: mailbox_id is Some(row_id) when the message came from the relay’s on-disk queue AND the recipient advertised ACK support in its Hello; None for live fan-out and pre-2.0 clients. skip_serializing_if keeps the field off the wire for live/legacy messages so old clients see exactly the bytes they expect.

Fields

§room: String
§payload_b64: String
§mailbox_id: Option<i64>
§seq: Option<i64>

huddle 2.0.8 (WS2 foundations #5): the relay-assigned per-room monotonic sequence number for total-ordered delivery — the foundation MLS commit ordering needs. None for non-room deliveries (SendDirect), offline-mailbox replays in this first slice, and pre-2.0.8 relays; additive, so older clients ignore it.

§

Sent

Fields

§delivered: usize
§queued: usize
§

ConnectToken

huddle 1.2.1: a freshly minted connect code + its lifetime (seconds).

Fields

§token: String
§ttl_secs: u64
§

ConnectTokenResolved

huddle 1.2.1: result of redeeming a connect code. fingerprint / pubkey_b64 are None when the code is unknown or expired. The relay echoes the token; the client ignores it.

Fields

§token: String
§fingerprint: Option<String>
§pubkey_b64: Option<String>
§

Pong

§

Error

Fields

§message: String

Trait Implementations§

Source§

impl Clone for ServerMsg

Source§

fn clone(&self) -> ServerMsg

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 ServerMsg

Source§

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

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

impl<'de> Deserialize<'de> for ServerMsg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ServerMsg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V