Skip to main content

Capabilities

Struct Capabilities 

Source
pub struct Capabilities {
Show 17 fields pub imap4rev1: bool, pub imap4rev2: bool, pub starttls: bool, pub login_disabled: bool, pub idle: bool, pub unselect: bool, pub condstore: bool, pub qresync: bool, pub move_ext: bool, pub uidplus: bool, pub literal_plus: bool, pub literal_minus: bool, pub enable: bool, pub auth_plain: bool, pub auth_login: bool, pub auth_xoauth2: bool, pub auth_oauthbearer: bool,
}
Expand description

Parsed view of a server’s advertised IMAP capabilities.

Each field is true when the corresponding capability atom was present in the server’s CAPABILITY list. Unknown atoms are ignored.

Fields§

§imap4rev1: bool

IMAP4rev1 (RFC 3501) base protocol.

§imap4rev2: bool

IMAP4rev2 (RFC 9051) base protocol.

§starttls: bool

STARTTLS — cleartext-to-TLS upgrade is supported.

§login_disabled: bool

LOGINDISABLED — the LOGIN command is refused (typically pre-TLS).

§idle: bool

IDLE (RFC 2177) — server-pushed mailbox updates.

§unselect: bool

UNSELECT (RFC 3691) — leave the selected mailbox without expunging.

§condstore: bool

CONDSTORE (RFC 7162) — conditional store / mod-sequences.

§qresync: bool

QRESYNC (RFC 7162) — quick mailbox resynchronization.

§move_ext: bool

MOVE (RFC 6851) — atomic message move.

§uidplus: bool

UIDPLUS (RFC 4315) — UID EXPUNGE and assigned-UID responses.

§literal_plus: bool

LITERAL+ (RFC 7888) — non-synchronizing literals.

§literal_minus: bool

LITERAL- (RFC 7888) — non-synchronizing literals capped at 4096 octets.

§enable: bool

ENABLE (RFC 5161) — opt into extensions for the session.

§auth_plain: bool

AUTH=PLAIN SASL mechanism.

§auth_login: bool

AUTH=LOGIN SASL mechanism.

§auth_xoauth2: bool

AUTH=XOAUTH2 SASL mechanism.

§auth_oauthbearer: bool

AUTH=OAUTHBEARER (RFC 7628) SASL mechanism.

Implementations§

Source§

impl Capabilities

Source

pub fn from_atoms<S: AsRef<str>>(atoms: &[S]) -> Self

Build from a list of capability atoms (e.g. as produced by the parser’s * CAPABILITY … data response). Unknown atoms are ignored.

Source

pub fn try_update_from(&mut self, response: &Response<'_>) -> bool

Update from a parsed Response if it carries capabilities — either a * CAPABILITY … data response or a [CAPABILITY …] response code on a status response. Returns true if anything was updated.

Source

pub fn from_frame(frame: &[u8]) -> Option<Self>

Best-effort parse of a raw frame. Returns Some(caps) if the bytes contain a CAPABILITY response (data or response-code); else None.

Source

pub fn parse(response: &str) -> Self

Substring-based parser kept for backward compatibility. Prefer Self::from_atoms or Self::from_frame — those use the real parser and avoid prefix collisions like IMAP4REV2X.

Trait Implementations§

Source§

impl Clone for Capabilities

Source§

fn clone(&self) -> Capabilities

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Capabilities

Source§

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

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

impl Default for Capabilities

Source§

fn default() -> Capabilities

Returns the “default value” for a type. Read more

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