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
sourceimpl Deleted
impl Deleted
sourcepub fn from_expunged(v: Vec<u32>) -> Self
pub fn from_expunged(v: Vec<u32>) -> 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>>) -> Self
pub fn from_vanished(v: Vec<RangeInclusive<u32>>) -> 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Deleted
impl Send for Deleted
impl Sync for Deleted
impl Unpin for Deleted
impl UnwindSafe for Deleted
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more