pub enum UnsolicitedResponse {
    Status {
        mailbox: String,
        attributes: Vec<StatusAttribute>,
    },
    Recent(u32),
    Exists(u32),
    Expunge(u32),
    Other(ResponseData),
}
Expand description

Responses that the server sends that are not related to the current command. RFC 3501 states that clients need to be able to accept any response at any time. These are the ones we’ve encountered in the wild.

Note that Recent, Exists and Expunge responses refer to the currently SELECTed folder, so the user must take care when interpreting these.

Variants§

§

Status

Fields

§mailbox: String

The mailbox that this status response is for.

§attributes: Vec<StatusAttribute>

The attributes of this mailbox.

An unsolicited STATUS response.

§

Recent(u32)

An unsolicited RECENT response indicating the number of messages with the \Recent flag set. This response occurs if the size of the mailbox changes (e.g., new messages arrive).

Note: It is not guaranteed that the message sequence numbers of recent messages will be a contiguous range of the highest n messages in the mailbox (where n is the value reported by the RECENT response). Examples of situations in which this is not the case are: multiple clients having the same mailbox open (the first session to be notified will see it as recent, others will probably see it as non-recent), and when the mailbox is re-ordered by a non-IMAP agent.

The only reliable way to identify recent messages is to look at message flags to see which have the \Recent flag set, or to do a SEARCH RECENT.

§

Exists(u32)

An unsolicited EXISTS response that reports the number of messages in the mailbox. This response occurs if the size of the mailbox changes (e.g., new messages arrive).

§

Expunge(u32)

An unsolicited EXPUNGE response that reports that the specified message sequence number has been permanently removed from the mailbox. The message sequence number for each successive message in the mailbox is immediately decremented by 1, and this decrement is reflected in message sequence numbers in subsequent responses (including other untagged EXPUNGE responses).

The EXPUNGE response also decrements the number of messages in the mailbox; it is not necessary to send an EXISTS response with the new value.

As a result of the immediate decrement rule, message sequence numbers that appear in a set of successive EXPUNGE responses depend upon whether the messages are removed starting from lower numbers to higher numbers, or from higher numbers to lower numbers. For example, if the last 5 messages in a 9-message mailbox are expunged, a “lower to higher” server will send five untagged EXPUNGE responses for message sequence number 5, whereas a “higher to lower server” will send successive untagged EXPUNGE responses for message sequence numbers 9, 8, 7, 6, and 5.

§

Other(ResponseData)

Any other kind of unsolicted response.

Trait Implementations§

source§

impl Debug for UnsolicitedResponse

source§

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

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

impl PartialEq for UnsolicitedResponse

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for UnsolicitedResponse

source§

impl StructuralPartialEq for UnsolicitedResponse

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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