Skip to main content

Capability

Enum Capability 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

QUOTASETSETQUOTA 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

Source

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).

Source

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

Source§

fn clone(&self) -> Capability

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Capability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Capability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&str> for Capability

Converts a string slice to a Capability using case-insensitive matching (RFC 3501 Section 7.2.1).

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Capability

Converts a string to a Capability using case-insensitive matching (RFC 3501 Section 7.2.1).

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

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§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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.

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.

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Capability

RFC 3501 Section 7.2.1: capability equality is reflexive, symmetric, transitive.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more