pub enum Flag {
Seen,
Answered,
Flagged,
Deleted,
Draft,
Custom(String),
}
Expand description
The email envelope flag.
A flag is like a tag that can be attached to an email
envelope. The concept of flag is the same across backends, but
their definition may vary. For example, the flag representing
answered emails is called \Answered
for IMAP backend but is
called R
(replied) for Maildir backend. This implementation
tries to be as simple as possible and should fit most of the use
cases.
Variants§
Seen
Flag used when the email envelope has been opened.
Answered
Flag used when the email has been answered.
Flagged
Flag used as a bookmark. The meaning is specific to the user: it could be important, starred, to check etc.
Deleted
Flag used when the email is marked for deletion.
Draft
Flag used when the email is a draft and is therefore not complete.
Custom(String)
Flag used for all other use cases.
Implementations§
source§impl Flag
impl Flag
pub fn try_from_imap_flag(imap_flag: &Flag<'_>) -> Result<Self, Error>
pub fn to_imap_query_string(&self) -> String
pub fn to_imap_flag(&self) -> Flag<'static>
Trait Implementations§
source§impl From<&str> for Flag
impl From<&str> for Flag
Parse a flag from a string. If the string does not match any of the existing variant, it is considered as custom.
source§impl FromIterator<Flag> for Flags
impl FromIterator<Flag> for Flags
source§impl FromStr for Flag
impl FromStr for Flag
Parse a flag from a string. If the string does not match any of the existing variant, it returns an error.
source§impl Ord for Flag
impl Ord for Flag
source§impl PartialEq for Flag
impl PartialEq for Flag
source§impl PartialOrd for Flag
impl PartialOrd for Flag
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 Flag
impl StructuralPartialEq for Flag
Auto Trait Implementations§
impl Freeze for Flag
impl RefUnwindSafe for Flag
impl Send for Flag
impl Sync for Flag
impl Unpin for Flag
impl UnwindSafe for Flag
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.