pub struct Envelope {
pub id: String,
pub message_id: String,
pub in_reply_to: Option<String>,
pub flags: Flags,
pub from: Address,
pub to: Address,
pub subject: String,
pub date: DateTime<FixedOffset>,
pub has_attachment: bool,
}
Expand description
Fields§
§id: String
The shape of the envelope identifier may vary depending on the backend. For IMAP backend, it is an stringified auto-incremented integer. For Notmuch backend it is a Git-like hash.
message_id: String
The Message-ID header from the email message.
in_reply_to: Option<String>
The In-Reply-To header from the email message.
flags: Flags
The envelope flags.
from: Address
The first address from the email message header From.
to: Address
The first address from the email message header To.
subject: String
The Subject header from the email message.
date: DateTime<FixedOffset>
The Date header from the email message.
has_attachment: bool
True if the current envelope contains at least one attachment.
An attachment is defined here as a MIME part that is not a
text/*
.
Implementations§
Source§impl Envelope
impl Envelope
pub fn from_imap_data_items(items: &[MessageDataItem<'_>]) -> Self
Source§impl Envelope
impl Envelope
pub fn set_some_from(&mut self, addr: Option<Address>)
pub fn set_some_to(&mut self, addr: Option<Address>)
pub fn set_some_date(&mut self, date: Option<&DateTime>)
Sourcepub fn set_date(&mut self, date: &DateTime)
pub fn set_date(&mut self, date: &DateTime)
Transform a mail_parser::DateTime
into a fixed offset chrono::DateTime
and add it to the current envelope.
Sourcepub fn format_date(&self, config: &AccountConfig) -> String
pub fn format_date(&self, config: &AccountConfig) -> String
Format the envelope date according to the datetime format and timezone from the account configuration.
Sourcepub fn to_sync_cache_msg(&self) -> String
pub fn to_sync_cache_msg(&self) -> String
Build a message from the current envelope.
The message is just composed of two headers and contains no content. It is mostly used by the synchronization to cache envelopes.
pub fn as_threaded(&self) -> ThreadedEnvelope<'_>
Trait Implementations§
Source§impl FromIterator<Envelope> for Envelopes
impl FromIterator<Envelope> for Envelopes
Source§impl Ord for Envelope
impl Ord for Envelope
Source§impl PartialOrd for Envelope
impl PartialOrd for Envelope
Source§impl TryFrom<MaildirEntry> for Envelope
impl TryFrom<MaildirEntry> for Envelope
impl Eq 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 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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more