Skip to main content

SendMessagePayload

Struct SendMessagePayload 

Source
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: body is 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 is skip_serializing_if when absent.
  • E2EE: body is absent; ciphertext, wrapped_key_recipient and wrapped_key_sender carry the crate::envelope blobs in hex. Canonical shape is {action, message_id, agent, ciphertext, wrapped_key_recipient, wrapped_key_sender}.

Fields§

§message_id: MessageId

Client-generated message UUID. Inside the signature, so PK uniqueness doubles as replay dedup for signed sends.

§agent: String

Name 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

Source§

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

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

impl<'de> Deserialize<'de> for SendMessagePayload

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<'a> From<&'a SendMessagePayload> for SignedAction<'a>

Source§

fn from(p: &'a SendMessagePayload) -> Self

Converts to this type from the input type.
Source§

impl Serialize for SendMessagePayload

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> PendingHandle for T
where T: Send + 'static,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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