Expand description
A struct containing message sequence numbers or UID sequence sets and a mod
sequence 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. If QRESYNC
is
enabled, the server will also return the mod sequence of the completed
operation.
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
}
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.messages: DeletedMessages
The list of messages that were expunged
mod_seq: Option<u64>
The mod sequence of the performed operation, if the QRESYNC
extension
is enabled.
Implementations§
source§impl Deleted
impl Deleted
sourcepub fn from_expunged(v: Vec<u32>, mod_seq: Option<u64>) -> Self
pub fn from_expunged(v: Vec<u32>, mod_seq: Option<u64>) -> Self
Construct a new Deleted
value from a vector of message sequence
numbers returned in one or more EXPUNGE
responses.
sourcepub fn from_vanished(v: Vec<RangeInclusive<u32>>, mod_seq: Option<u64>) -> Self
pub fn from_vanished(v: Vec<RangeInclusive<u32>>, mod_seq: Option<u64>) -> Self
Construct a new Deleted
value from a sequence-set of UIDs
returned in a VANISHED
response
sourcepub fn seqs(&self) -> impl Iterator<Item = Seq> + '_
pub fn seqs(&self) -> impl Iterator<Item = Seq> + '_
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.