#[non_exhaustive]pub enum Capability {
Show 48 variants
Imap4Rev1,
Imap4Rev2,
Acl,
AppendLimit(Option<u64>),
Binary,
Children,
CompressDeflate,
Condstore,
CreateSpecialUse,
Enable,
Esearch,
Id,
Idle,
ListExtended,
ListStatus,
LiteralPlus,
LoginDisabled,
LiteralMinus,
Metadata,
MetadataServer,
Move,
MultiAppend,
Namespace,
Notify,
ObjectId,
QResync,
Quota,
QuotaResource(String),
QuotaSet,
Rights(String),
Preview,
SaslIr,
SaveDate,
SearchRes,
Sort,
SortDisplay(String),
StartTls,
SpecialUse,
Thread(String),
StatusSize,
UidPlus,
Unauthenticate,
Unselect,
Utf8Accept,
Utf8Only,
Within,
Auth(String),
Other(String),
}Expand description
Server capability (RFC 3501 Section 7.2.1 / RFC 9051 Section 7.2.1).
Comparison and hashing are case-insensitive per RFC 3501 Section 7.2.1.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Imap4Rev1
IMAP4rev1 (RFC 3501).
Imap4Rev2
IMAP4rev2 (RFC 9051).
Acl
ACL (RFC 4314).
AppendLimit(Option<u64>)
APPENDLIMIT (RFC 7889 Section 5).
Binary
BINARY (RFC 3516).
Children
CHILDREN (RFC 3348).
CompressDeflate
COMPRESS=DEFLATE (RFC 4978).
Condstore
CONDSTORE (RFC 7162).
CreateSpecialUse
CREATE-SPECIAL-USE (RFC 6154).
Enable
ENABLE (RFC 5161).
Esearch
ESEARCH (RFC 4731).
Id
ID (RFC 2971).
Idle
IDLE (RFC 2177).
ListExtended
LIST-EXTENDED (RFC 5258).
ListStatus
LIST-STATUS (RFC 5819).
LiteralPlus
LITERAL+ (RFC 7888).
LoginDisabled
LOGINDISABLED (RFC 3501 Section 6.2.3 / RFC 9051 Section 6.2.3).
LiteralMinus
LITERAL- extension — non-synchronizing literals up to 4096 bytes (RFC 7888 Section 5).
Metadata
METADATA (RFC 5464).
MetadataServer
METADATA-SERVER — server-only metadata annotations (RFC 5464 Section 1).
Move
MOVE (RFC 6851).
MultiAppend
MULTIAPPEND (RFC 3502).
Namespace
NAMESPACE (RFC 2342).
Notify
NOTIFY (RFC 5465).
ObjectId
OBJECTID (RFC 8474).
QResync
QRESYNC (RFC 7162).
Quota
QUOTA (RFC 2087).
QuotaResource(String)
QUOTA=RES-<name> — advertised quota resource type (RFC 9208 Section 3.1.1).
QuotaSet
QUOTASET — SETQUOTA command support (RFC 9208 Section 4.1.3).
Rights(String)
RIGHTS=<chars> — indicates supported ACL rights (RFC 4314 Section 6).
The String holds the new-rights characters (e.g. "texk").
Preview
PREVIEW (RFC 8970 Section 4).
SaslIr
SASL-IR (RFC 4959).
SaveDate
SAVEDATE (RFC 8514).
SearchRes
SEARCHRES (RFC 5182).
Sort
SORT extension (RFC 5256 Section 1).
SortDisplay(String)
SORT=DISPLAY extension (RFC 5957).
StartTls
STARTTLS (RFC 3501 Section 6.2.1 / RFC 9051 Section 6.2.1).
SpecialUse
SPECIAL-USE (RFC 6154).
Thread(String)
THREAD=<algorithm> (RFC 5256 Section 1).
The String holds the algorithm name (e.g. "REFERENCES", "ORDEREDSUBJECT").
Servers may advertise multiple THREAD= capabilities, each as a separate entry.
StatusSize
STATUS=SIZE (RFC 8438).
UidPlus
UIDPLUS (RFC 4315).
Unauthenticate
UNAUTHENTICATE (RFC 8437 Section 2).
Unselect
UNSELECT (RFC 3691).
Utf8Accept
UTF8=ACCEPT (RFC 6855).
Utf8Only
UTF8=ONLY (RFC 6855 Section 4).
Within
WITHIN (RFC 5032 Section 3).
Enables OLDER and YOUNGER search keys for time-relative searches.
Auth(String)
AUTH=<mechanism> (e.g. AUTH=PLAIN, AUTH=XOAUTH2) (RFC 3501 Section 7.2.1).
Other(String)
Unrecognized capability — preserved verbatim.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn as_imap_str(&self) -> String
pub fn as_imap_str(&self) -> String
Returns the wire representation of this capability
(e.g. IDLE, AUTH=PLAIN, THREAD=REFERENCES)
(RFC 3501 Section 7.2.1 / RFC 9051 Section 7.2.1).
Sourcepub fn from_imap_str(s: &str) -> Self
pub fn from_imap_str(s: &str) -> Self
Parse a capability token from its IMAP wire representation (RFC 3501 Section 7.2.1 / RFC 9051 Section 7.2.2).
Case-insensitive per RFC 3501 Section 7.2.1: “Strstrings in capability names are case-insensitive.”
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Capability
impl Debug for Capability
Source§impl Display for Capability
impl Display for Capability
Source§impl From<&str> for Capability
Converts a string slice to a Capability using case-insensitive matching
(RFC 3501 Section 7.2.1).
impl From<&str> for Capability
Converts a string slice to a Capability using case-insensitive matching
(RFC 3501 Section 7.2.1).
Source§impl From<String> for Capability
Converts a string to a Capability using case-insensitive matching
(RFC 3501 Section 7.2.1).
impl From<String> for Capability
Converts a string to a Capability using case-insensitive matching
(RFC 3501 Section 7.2.1).
Source§impl Hash for Capability
RFC 3501 Section 7.2.1: capability names are case-insensitive.
impl Hash for Capability
RFC 3501 Section 7.2.1: capability names are case-insensitive.
The Hash implementation must be consistent with PartialEq: capabilities that
compare equal must hash to the same value. Because Other("IDLE") must
equal Idle, we hash the lowercased wire form (as_imap_str()) for all
variants, which is identical for cross-representation equivalents.
Source§impl PartialEq for Capability
RFC 3501 Section 7.2.1: “There is no requirement that capability names be
registered” — capability names are atoms and IMAP atoms are case-insensitive.
impl PartialEq for Capability
RFC 3501 Section 7.2.1: “There is no requirement that capability names be registered” — capability names are atoms and IMAP atoms are case-insensitive.
Known capability variants with no string payload compare by discriminant.
String-carrying variants (Auth, Thread, SortDisplay, Rights, Other)
compare using ASCII case-insensitive comparison so that e.g.
Auth("PLAIN") and Auth("plain") are treated as the same capability.
Cross-representation is also handled: Other("IDLE") equals Idle,
because they denote the same protocol capability.
impl Eq for Capability
RFC 3501 Section 7.2.1: capability equality is reflexive, symmetric, transitive.