pub enum Deleted {
    Expunged(Vec<Seq>),
    Vanished(Vec<RangeInclusive<Uid>>),
}
Expand description

An enum representing message sequence numbers or UID sequence sets returned in response to a EXPUNGE command.

The EXPUNGE command may return several EXPUNGE responses referencing message sequence numbers, or it may return a VANISHED response referencing multiple UID values in a sequence set if the client has enabled QRESYNC.

Deleted implements some iterators to make it easy to use. If the caller knows that they should be receiving an EXPUNGE or VANISHED response, then they can use seqs() to get an iterator over EXPUNGE message sequence numbers, or uids() to get an iterator over the VANISHED UIDs. As a convenience Deleted also implents IntoIterator which just returns an iterator over whatever is contained within.

Examples

    .native_tls().unwrap();
// Iterate over whatever is returned
if let Ok(deleted) = session.expunge() {
    for id in &deleted {
        // Do something with id
    }
}

// Expect a VANISHED response with UIDs
if let Ok(deleted) = session.expunge() {
    for uid in deleted.uids() {
        // Do something with uid
    }
}

Variants

Expunged(Vec<Seq>)

Message sequence numbers given in an EXPUNGE response.

Vanished(Vec<RangeInclusive<Uid>>)

Message UIDs given in a VANISHED response.

Implementations

Construct a new Deleted value from a vector of message sequence numbers returned in one or more EXPUNGE responses.

Construct a new Deleted value from a sequence-set of UIDs returned in a VANISHED response

Return an iterator over message sequence numbers from an EXPUNGE response. If the client is expecting sequence numbers this function can be used to ensure only sequence numbers returned in an EXPUNGE response are processed.

Return an iterator over UIDs returned in a VANISHED response. If the client is expecting UIDs this function can be used to ensure only UIDs are processed.

Return if the set is empty

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.