pub struct Envelope {
pub id: String,
pub message_id: String,
pub flags: Flags,
pub from: Address,
pub to: Address,
pub subject: String,
pub date: DateTime<FixedOffset>,
}
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.
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.
Implementations§
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.
Trait Implementations§
source§impl FromIterator<Envelope> for Envelopes
impl FromIterator<Envelope> for Envelopes
source§impl Ord for Envelope
impl Ord for Envelope
source§impl PartialEq for Envelope
impl PartialEq for Envelope
source§impl PartialOrd for Envelope
impl PartialOrd for Envelope
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl 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<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
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.