pub struct Envelope {
pub id: String,
pub message_id: Option<String>,
pub flags: BTreeSet<Flag>,
pub subject: String,
pub from: Vec<Address>,
pub to: Vec<Address>,
pub date: Option<DateTime<FixedOffset>>,
pub size: u64,
pub has_attachment: Option<bool>,
}Expand description
Lightweight summary of a message: enough to display in a list without fetching the full body.
Fields§
§id: StringBackend-specific identifier of the message.
IMAP UID, JMAP email ID or Maildir filename id.
message_id: Option<String>Message-ID: header value (RFC 5322 §3.6.4), None when the
header is missing or the backend did not surface it. Stable
across every backend that stores the message, so sync uses it
as the cross-side content key when available.
flags: BTreeSet<Flag>Flags set on the message. Stored as a sorted set since wire
order is not meaningful and duplicates are nonsensical; the
derived Ord on Flag gives deterministic iteration.
subject: StringSubject header value.
from: Vec<Address>Sender(s).
to: Vec<Address>Primary recipient(s).
date: Option<DateTime<FixedOffset>>Author-claimed send time, taken from the Date: header
(IMAP ENVELOPE.date, JMAP sentAt, parsed Date: for
Maildir).
Server-arrival timestamps (IMAP INTERNALDATE, JMAP
receivedAt, filesystem mtime) are intentionally not used:
Maildir mtime is rewritten by every fresh sync, and the
Date: header is the only timestamp consistent across every
backend. None when the header is missing or unparseable.
size: u64Size of the raw RFC 5322 message in bytes. Free on every
backend (IMAP RFC822.SIZE, JMAP size, filesystem entry
size).
has_attachment: Option<bool>Whether the message has at least one attachment, when the
caller opted in. JMAP returns this for free; IMAP requires a
BODYSTRUCTURE fetch; Maildir requires parsing the message
body. None when not requested or when detection is not
implemented for the active backend.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
impl<'de> Deserialize<'de> for Envelope
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>,
impl Eq for Envelope
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.