pub enum DirectMessageBody {
Text {
text: String,
},
Invite(Box<InvitePayload>),
}Expand description
Structured plaintext payload of a direct message.
Round-trips through encode_body / decode_body. Legacy
plaintext (any pre-this-format DM, which was raw UTF-8 bytes)
decodes via decode_body as DirectMessageBody::Text using a
lossy UTF-8 conversion — see decode_body’s documentation.
The Invite variant carries its inner fields in a boxed
InvitePayload sub-struct so the enum’s stack size doesn’t blow
up under clippy::large_enum_variant — VerifyingKey is 32 bytes
plus alignment slack, plus an inline Option<String>, plus the
heap-pointer of invitation_payload. Boxing keeps the enum
discriminant + pointer small (16 bytes on 64-bit) regardless of
which variant is active. Wire format is unaffected: ciborium
encodes Box<T> exactly the same as T.
Variants§
Text
Plain user-typed text. Equivalent in wire bytes to what was previously the entire decrypted body.
Invite(Box<InvitePayload>)
Structured invite handed peer-to-peer via DM. The recipient renders this as an “Invitation card” with an Accept button that re-uses the URL-bar accept-invitation handler — no full page reload required.
Trait Implementations§
Source§impl Clone for DirectMessageBody
impl Clone for DirectMessageBody
Source§fn clone(&self) -> DirectMessageBody
fn clone(&self) -> DirectMessageBody
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DirectMessageBody
impl Debug for DirectMessageBody
Source§impl<'de> Deserialize<'de> for DirectMessageBody
impl<'de> Deserialize<'de> for DirectMessageBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DirectMessageBody
impl PartialEq for DirectMessageBody
Source§fn eq(&self, other: &DirectMessageBody) -> bool
fn eq(&self, other: &DirectMessageBody) -> bool
self and other values to be equal, and is used by ==.