#[non_exhaustive]pub enum ChatWsFrame {
StateChange(StateChange),
Response(JmapResponse),
ChatTyping(ChatTypingEvent),
ChatPresence(ChatPresenceEvent),
Unknown {
type_name: String,
},
}Expand description
A parsed frame from the JMAP Chat WebSocket, including chat-specific variants.
Marked #[non_exhaustive] because the spec may define additional @type
values in future revisions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StateChange(StateChange)
RFC 8620 §7.1 StateChange — one or more object types have changed state.
Response(JmapResponse)
RFC 8887 Response — reply to a JMAP request sent on this connection.
ChatTyping(ChatTypingEvent)
Ephemeral typing indicator (draft-atwood-jmap-chat-wss-00).
Delivered only after a ChatStreamEnable subscription has been sent.
ChatPresence(ChatPresenceEvent)
Ephemeral presence update (draft-atwood-jmap-chat-wss-00).
Delivered only after a ChatStreamEnable subscription has been sent.
Unknown
Unrecognized @type — ignored per forward-compatibility rules
(clients SHOULD ignore unknown message types per RFC 8887 §4.3.1).
Also produced when a known chat type fails to deserialize — type_name
will be "ChatTypingEvent" or "ChatPresenceEvent" in that case.
Fields
type_name: StringThe unknown-frame discriminant value. Possible sources:
- The verbatim
@typestring from the underlyingWsFrame::Unknownwhen the chat-side parser does not recognise it (typical: future chat-extension events). "<no @type>"(the literal string) when the underlyingWsFrame::Unknownitself reported an absent@typefield — that sentinel originates injmap-base-clientand propagates through unchanged."ChatTypingEvent"or"ChatPresenceEvent"when a known chat-event type failed payload deserialization (see the parent variant’s doc comment above)."<unknown>"when the underlyingWsFrameis a future non-Unknownvariant added byjmap-base-clientafterparse_chat_ws_framewas last updated.
Callers wishing to distinguish “server sent JSON without
@type” from “this parser doesn’t recognise the value”
must match on the literal strings; the field intentionally
flattens both cases into one String to keep the variant
shape stable across future spec edits.
Trait Implementations§
Source§impl Clone for ChatWsFrame
impl Clone for ChatWsFrame
Source§fn clone(&self) -> ChatWsFrame
fn clone(&self) -> ChatWsFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more