#[non_exhaustive]pub enum MailboxRole {
Inbox,
Trash,
Sent,
Drafts,
Junk,
Archive,
Flagged,
Important,
All,
Other(String),
}Expand description
The role of a Mailbox, identifying its common purpose (RFC 8621 §2).
Values correspond to IMAP Mailbox Name Attributes (RFC 8457), converted to lowercase. An account is not required to have Mailboxes with any particular role, and at most one Mailbox per account may hold each role.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Inbox
The primary inbox for new incoming messages.
Trash
Deleted messages.
Sent
Sent messages.
Drafts
Unsent draft messages.
Junk
Messages identified as likely spam.
Archive
Archived messages.
Flagged
Messages flagged for follow-up.
Important
Messages considered important.
All
Virtual mailbox containing all messages.
Other(String)
Any role string not recognized by this implementation.
RFC 8621 §2: “An unrecognized role SHOULD be treated as if no role were set.”
The inner string retains the original value received from the server, so
this variant round-trips correctly. When sending a Mailbox/set request
for a mailbox whose role came from the server, it is safe to echo the role
back — or omit it by setting role to None.
Implementations§
Source§impl MailboxRole
impl MailboxRole
Sourcepub fn to_wire_str(&self) -> &str
pub fn to_wire_str(&self) -> &str
Return the RFC 8621 wire-format string for this role.
Because this method is defined inside the crate that owns MailboxRole,
the match is exhaustive even though the enum is #[non_exhaustive].
Adding a new variant without updating this method is a compile error.
Trait Implementations§
Source§impl Clone for MailboxRole
impl Clone for MailboxRole
Source§fn clone(&self) -> MailboxRole
fn clone(&self) -> MailboxRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MailboxRole
impl Debug for MailboxRole
Source§impl<'de> Deserialize<'de> for MailboxRole
impl<'de> Deserialize<'de> for MailboxRole
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for MailboxRole
impl Display for MailboxRole
impl Eq for MailboxRole
Source§impl Hash for MailboxRole
impl Hash for MailboxRole
Source§impl PartialEq for MailboxRole
impl PartialEq for MailboxRole
Source§fn eq(&self, other: &MailboxRole) -> bool
fn eq(&self, other: &MailboxRole) -> bool
self and other values to be equal, and is used by ==.