Skip to main content

MessageSummary

Struct MessageSummary 

Source
pub struct MessageSummary {
    pub id: MessageId,
    pub sender_id: AgentId,
    pub sender_name: String,
    pub recipient_id: Option<AgentId>,
    pub encryption: MessageEncryption,
    pub body: Option<String>,
    pub sent_at: DateTime<Utc>,
    pub read_at: Option<DateTime<Utc>>,
    pub ciphertext: Option<String>,
    pub wrapped_key: Option<String>,
    pub sender_public_key: Option<String>,
}
Expand description

One message as rendered in an inbox.

recipient_id is None for broadcasts. body is None when the server cannot produce plaintext (E2EE rows, phase 2) — clients decrypt those locally from the ciphertext fields that phase 2 adds.

Fields§

§id: MessageId§sender_id: AgentId§sender_name: String§recipient_id: Option<AgentId>

None = system broadcast (delivered to every agent).

§encryption: MessageEncryption§body: Option<String>

Plaintext body (server-mode and broadcasts). None for E2EE.

§sent_at: DateTime<Utc>§read_at: Option<DateTime<Utc>>

When this agent read the message. None = unread.

§ciphertext: Option<String>

E2EE only: hex envelope blob (version || xnonce || ct).

§wrapped_key: Option<String>

E2EE only: hex message key wrapped to this agent’s X25519 key (the recipient wrap for inbox rows, the sender wrap for outbox export).

§sender_public_key: Option<String>

E2EE only: the sender’s hex Ed25519 public key, for verifying the embedded message signature. TOFU: pin it — a key change for a known sender is a red flag, not a routine event.

Implementations§

Source§

impl MessageSummary

Source

pub fn decrypt( &self, own_secret: &EncryptionSecretKey, ) -> Option<Result<String, EnvelopeError>>

Decrypt and verify an E2EE message with this agent’s encryption secret. Returns the plaintext, or None if this is not an E2EE row (use body directly).

Verification uses the row’s own context fields and sender_public_key — callers doing TOFU pinning should check the key against their pin first.

Trait Implementations§

Source§

impl Clone for MessageSummary

Source§

fn clone(&self) -> MessageSummary

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MessageSummary

Source§

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

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

impl<'de> Deserialize<'de> for MessageSummary

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 Serialize for MessageSummary

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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