Skip to main content

DataResponse

Enum DataResponse 

Source
pub enum DataResponse<'a> {
    Capability(Vec<&'a str>),
    List {
        flags: Vec<&'a str>,
        delimiter: Option<&'a str>,
        name: &'a str,
    },
    Lsub {
        flags: Vec<&'a str>,
        delimiter: Option<&'a str>,
        name: &'a str,
    },
    Status {
        mailbox: &'a str,
        items: Vec<StatusItem>,
    },
    Search(Vec<u32>),
    Flags(Vec<&'a str>),
    Exists(u32),
    Recent(u32),
    Expunge(u32),
    Fetch {
        seq: u32,
        attributes: Vec<FetchAttribute<'a>>,
    },
    Other(&'a [u8]),
}
Expand description

An untagged data response (* …).

Variants§

§

Capability(Vec<&'a str>)

CAPABILITY — the server’s advertised capabilities.

§

List

LIST — a mailbox returned by the LIST command.

Fields

§flags: Vec<&'a str>

Mailbox attribute flags (e.g. \Noselect, \HasChildren).

§delimiter: Option<&'a str>

Hierarchy delimiter, or None for a flat namespace (NIL).

§name: &'a str

The mailbox name.

§

Lsub

LSUB — a subscribed mailbox returned by the LSUB command.

Fields

§flags: Vec<&'a str>

Mailbox attribute flags.

§delimiter: Option<&'a str>

Hierarchy delimiter, or None (NIL).

§name: &'a str

The mailbox name.

§

Status

STATUS — requested status attributes for a mailbox.

Fields

§mailbox: &'a str

The mailbox the status items describe.

§items: Vec<StatusItem>

The returned status items.

§

Search(Vec<u32>)

SEARCH — message numbers (or UIDs) matching a search.

§

Flags(Vec<&'a str>)

FLAGS — the flags defined in the selected mailbox.

§

Exists(u32)

EXISTS — the number of messages in the mailbox.

§

Recent(u32)

RECENT — the number of messages with the \Recent flag.

§

Expunge(u32)

EXPUNGE — the sequence number of a message that was expunged.

§

Fetch

FETCH — message data for a single message.

Fields

§seq: u32

The message sequence number.

§attributes: Vec<FetchAttribute<'a>>

The fetched attributes for this message.

§

Other(&'a [u8])

Unrecognized untagged data response — the raw line bytes (without CRLF).

Trait Implementations§

Source§

impl<'a> Debug for DataResponse<'a>

Source§

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

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

impl<'a> Eq for DataResponse<'a>

Source§

impl<'a> PartialEq for DataResponse<'a>

Source§

fn eq(&self, other: &DataResponse<'a>) -> 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<'a> StructuralPartialEq for DataResponse<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for DataResponse<'a>

§

impl<'a> RefUnwindSafe for DataResponse<'a>

§

impl<'a> Send for DataResponse<'a>

§

impl<'a> Sync for DataResponse<'a>

§

impl<'a> Unpin for DataResponse<'a>

§

impl<'a> UnsafeUnpin for DataResponse<'a>

§

impl<'a> UnwindSafe for DataResponse<'a>

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