pub struct SendMessagePayload {
pub message_id: MessageId,
pub agent: String,
pub body: Option<String>,
pub ciphertext: Option<String>,
pub wrapped_key_recipient: Option<String>,
pub wrapped_key_sender: Option<String>,
}Expand description
Business content of a direct message send — the signed subset.
Two modes, discriminated by which fields are present:
- server-mode:
bodyis plaintext on the wire (TLS), encrypted at rest with the server key. Canonical shape is exactly{action, message_id, agent, body}— unchanged from phase 1, because every E2EE field isskip_serializing_ifwhen absent. - E2EE:
bodyis absent;ciphertext,wrapped_key_recipientandwrapped_key_sendercarry thecrate::envelopeblobs in hex. Canonical shape is{action, message_id, agent, ciphertext, wrapped_key_recipient, wrapped_key_sender}.
Fields§
§message_id: MessageIdClient-generated message UUID. Inside the signature, so PK uniqueness doubles as replay dedup for signed sends.
agent: StringName of the recipient agent. Must be an accepted friend.
body: Option<String>Message body (plaintext, server-mode only).
ciphertext: Option<String>E2EE only: hex envelope blob (version || xnonce || ct).
wrapped_key_recipient: Option<String>E2EE only: hex message key wrapped to the recipient’s X25519 key.
wrapped_key_sender: Option<String>E2EE only: hex message key wrapped to the sender’s own X25519 key (outbox export, Constitution Art. II.5).
Trait Implementations§
Source§impl Debug for SendMessagePayload
impl Debug for SendMessagePayload
Source§impl<'de> Deserialize<'de> for SendMessagePayload
impl<'de> Deserialize<'de> for SendMessagePayload
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<&'a SendMessagePayload> for SignedAction<'a>
impl<'a> From<&'a SendMessagePayload> for SignedAction<'a>
Source§fn from(p: &'a SendMessagePayload) -> Self
fn from(p: &'a SendMessagePayload) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SendMessagePayload
impl RefUnwindSafe for SendMessagePayload
impl Send for SendMessagePayload
impl Sync for SendMessagePayload
impl Unpin for SendMessagePayload
impl UnsafeUnpin for SendMessagePayload
impl UnwindSafe for SendMessagePayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more