Skip to main content

ImapCommand

Enum ImapCommand 

Source
pub enum ImapCommand {
Show 30 variants Capability, Login { username: String, password: String, }, Logout, List { reference: String, pattern: String, }, Select { mailbox: String, }, Examine { mailbox: String, }, Fetch { sequence: String, attributes: String, }, Store { sequence: String, action: String, flags: String, }, Search { criteria: String, }, Expunge, Noop, Close, Idle, Append { mailbox: String, flags: Option<String>, literal_size: u32, }, Copy { sequence: String, mailbox: String, }, Move { sequence: String, mailbox: String, }, Uid { subcommand: Box<ImapCommand>, }, Status { mailbox: String, items: String, }, GetQuota { quotaroot: String, }, GetQuotaRoot { mailbox: String, }, Create { mailbox: String, }, Delete { mailbox: String, }, Rename { from: String, to: String, }, Subscribe { mailbox: String, }, Unsubscribe { mailbox: String, }, Lsub { reference: String, pattern: String, }, Namespace, Sort { criteria: String, charset: String, search_criteria: String, }, Enable(Vec<String>), Unselect,
}
Expand description

A parsed IMAP4rev1 command. Each variant owns its argument strings (commands cross network boundaries, so we don’t borrow).

Variants§

§

Capability

CAPABILITY — list supported extensions.

§

Login

LOGIN <user> <pass> — authenticate with plain credentials.

Fields

§username: String

Username argument.

§password: String

Password argument (plaintext per RFC 3501; clients should use STARTTLS).

§

Logout

LOGOUT — close the connection.

§

List

LIST <reference> <pattern> — enumerate matching mailbox names.

Fields

§reference: String

Reference name (usually empty string).

§pattern: String

Pattern with % (single-level) and * (recursive) wildcards.

§

Select

SELECT <mailbox> — open a mailbox for read/write.

Fields

§mailbox: String

Mailbox name.

§

Examine

EXAMINE <mailbox> — open a mailbox read-only.

Fields

§mailbox: String

Mailbox name.

§

Fetch

FETCH <seq> <attrs> — retrieve message attributes / parts.

Fields

§sequence: String

Sequence set (1:10, *, 1,3,5, etc).

§attributes: String

Attribute spec (FLAGS, BODY[], (FLAGS BODY.PEEK[HEADER]), …).

§

Store

STORE <seq> <action> <flags> — set/add/remove flags.

Fields

§sequence: String

Sequence set.

§action: String

One of FLAGS / +FLAGS / -FLAGS (+.SILENT variant).

§flags: String

Flag list (e.g. (\Seen)).

§

Search

SEARCH <criteria> — return UIDs matching the search keys.

Fields

§criteria: String

Search criteria string (UNSEEN FROM alice@x, etc).

§

Expunge

EXPUNGE — purge messages with the \Deleted flag.

§

Noop

NOOP — no-op (kept for keepalive + STATUS-update side effect).

§

Close

CLOSE — close the current mailbox (expunge implicit).

§

Idle

IDLE — push notifications until DONE (RFC 2177).

§

Append

APPEND <mailbox> [flags] {n}<CRLF>... — upload a new message.

Fields

§mailbox: String

Target mailbox.

§flags: Option<String>

Optional initial flag list (e.g. (\Seen \Flagged)).

§literal_size: u32

Literal byte count for the message body that follows.

§

Copy

COPY <seq> <mailbox> — copy messages to another mailbox.

Fields

§sequence: String

Sequence set in the source mailbox.

§mailbox: String

Destination mailbox name.

§

Move

MOVE <seq> <mailbox> (RFC 6851) — move messages.

Fields

§sequence: String

Sequence set in the source mailbox.

§mailbox: String

Destination mailbox name.

§

Uid

UID <subcommand> — re-interpret the subcommand’s sequence set as UIDs.

Fields

§subcommand: Box<ImapCommand>

The nested IMAP command operating on UIDs.

§

Status

STATUS <mailbox> <items> — read mailbox-level counts.

Fields

§mailbox: String

Mailbox name to inspect.

§items: String

Item list (e.g. (MESSAGES UNSEEN UIDNEXT UIDVALIDITY HIGHESTMODSEQ)).

§

GetQuota

GETQUOTA <quotaroot> — read a quota resource (RFC 2087).

Fields

§quotaroot: String

Quota root identifier.

§

GetQuotaRoot

GETQUOTAROOT <mailbox> — list quota roots applying to a mailbox.

Fields

§mailbox: String

Mailbox name.

§

Create

CREATE <mailbox> — create a mailbox.

Fields

§mailbox: String

New mailbox name.

§

Delete

DELETE <mailbox> — delete a mailbox.

Fields

§mailbox: String

Mailbox to delete.

§

Rename

RENAME <from> <to> — rename a mailbox.

Fields

§from: String

Existing mailbox name.

§to: String

New mailbox name.

§

Subscribe

SUBSCRIBE <mailbox> — add a mailbox to the user’s active list.

Fields

§mailbox: String

Mailbox to subscribe to.

§

Unsubscribe

UNSUBSCRIBE <mailbox> — remove from subscription list.

Fields

§mailbox: String

Mailbox to unsubscribe.

§

Lsub

LSUB <reference> <pattern> — list subscribed mailboxes.

Fields

§reference: String

Reference name (usually empty).

§pattern: String

Pattern.

§

Namespace

NAMESPACE — return per-user / per-shared / per-other namespace prefixes.

§

Sort

SORT <criteria> <charset> <search> — server-side sorted SEARCH (RFC 5256).

Fields

§criteria: String

Sort criteria (e.g. (DATE) / (REVERSE ARRIVAL)).

§charset: String

Charset for text values in search criteria.

§search_criteria: String

Search criteria (filter applied before sort).

§

Enable(Vec<String>)

ENABLE <ext>+ (RFC 5161) — opt into named extensions.

§

Unselect

UNSELECT (RFC 3691) — close mailbox without expunging.

Trait Implementations§

Source§

impl Clone for ImapCommand

Source§

fn clone(&self) -> ImapCommand

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 ImapCommand

Source§

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

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

impl PartialEq for ImapCommand

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 ImapCommand

Source§

impl StructuralPartialEq for ImapCommand

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.