#[non_exhaustive]pub struct WireRecord {Show 13 fields
pub store: String,
pub kind: WireRecordKind,
pub primary_key: String,
pub id: Option<String>,
pub conversation: Option<String>,
pub sender: Option<String>,
pub time: Option<String>,
pub message_type: Option<String>,
pub name: Option<String>,
pub text: Option<String>,
pub payload: PayloadState,
pub seq: u64,
pub deleted: bool,
}Expand description
One interpreted Wire record.
Fields absent from the source record stay None; only fields the record
actually carries are populated. #[non_exhaustive] so new fields do not
break consumers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.store: StringThe object-store name the record came from.
kind: WireRecordKindThe Wire role of the store.
primary_key: StringThe record’s primary key, rendered as text.
id: Option<String>The record’s own id field, if present.
conversation: Option<String>The conversation id the record belongs to, if present.
sender: Option<String>The sender/author (from) of an event, if present.
time: Option<String>The event/record timestamp as stored (ISO-8601 string), if present.
message_type: Option<String>The Wire event type (e.g. conversation.message-add), if present.
name: Option<String>A human name — conversation name, user display name, or device model.
text: Option<String>The cleartext message body, when one was recoverable.
payload: PayloadStateWhether the content is cleartext, encrypted, or undecodable.
seq: u64LevelDB sequence number (write ordering).
deleted: booltrue if this record is a deletion tombstone recovered from the store.
Implementations§
Source§impl WireRecord
impl WireRecord
Sourcepub fn decrypted_text(&self) -> Result<&str, WireError>
pub fn decrypted_text(&self) -> Result<&str, WireError>
The recoverable plaintext of this record’s message body.
Returns the cleartext body for a PayloadState::Cleartext record.
For an encrypted or undecodable payload it fails loud with a typed
error — it never fabricates plaintext.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Whether this record’s content is client-side encrypted and unrecoverable.
Trait Implementations§
Source§impl Clone for WireRecord
impl Clone for WireRecord
Source§fn clone(&self) -> WireRecord
fn clone(&self) -> WireRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more