Skip to main content

muse_code_sdk/msp/view/
item_peer_message.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6/// `peerMessage`: the four facts the consumed card renders. The fold reads them
7/// from the drained inbox record's delivery snapshot; `senderLabel` already ran
8/// the gate-off label rule host-side, so the client renders it verbatim. Stable
9/// from day one (the `scheduledFire` precedent): no `x-msp-stability` marker.
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
11#[serde(rename_all = "camelCase")]
12#[non_exhaustive]
13pub struct PeerMessage {
14    /// The peer label gate-off shows: the sender name when the
15    /// durable record names one, else the sender id shortened as
16    /// gate-off shortens it, else `unknown session` — and `remote
17    /// session` verbatim for a remote sender.
18    pub sender_label: String,
19    /// The local sender's session id; absent for remote senders and
20    /// when the record names none.
21    #[serde(default, skip_serializing_if = "Option::is_none")]
22    pub sender_session_id: Option<String>,
23    /// True for mailbox/remote senders, false for local session
24    /// senders.
25    pub remote: bool,
26    /// The message text verbatim — never cut (an over-budget event
27    /// answers the typed `pageEventTooLarge` arm).
28    pub body: String,
29}