imap_types/
status.rs

1use std::num::NonZeroU32;
2
3#[cfg(feature = "arbitrary")]
4use arbitrary::Arbitrary;
5#[cfg(feature = "bounded-static")]
6use bounded_static::ToStatic;
7#[cfg(feature = "serde")]
8use serde::{Deserialize, Serialize};
9
10/// Status data item name used to request a status data item.
11#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12#[cfg_attr(feature = "bounded-static", derive(ToStatic))]
13#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14#[derive(Debug, Clone, PartialEq, Eq, Hash)]
15#[doc(alias = "StatusAttribute")]
16pub enum StatusDataItemName {
17    /// The number of messages in the mailbox.
18    Messages,
19
20    /// The number of messages with the \Recent flag set.
21    Recent,
22
23    /// The next unique identifier value of the mailbox.
24    UidNext,
25
26    /// The unique identifier validity value of the mailbox.
27    UidValidity,
28
29    /// The number of messages which do not have the \Seen flag set.
30    Unseen,
31
32    /// The number of messages with the \Deleted flag set.
33    Deleted,
34
35    /// The amount of storage space that can be reclaimed by performing EXPUNGE on the mailbox.
36    DeletedStorage,
37
38    #[cfg(feature = "ext_condstore_qresync")]
39    #[cfg_attr(docsrs, doc(cfg(feature = "ext_condstore_qresync")))]
40    HighestModSeq,
41}
42
43/// Status data item.
44#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
45#[cfg_attr(feature = "bounded-static", derive(ToStatic))]
46#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
47#[derive(Debug, Clone, PartialEq, Eq, Hash)]
48#[doc(alias = "StatusAttributeValue")]
49pub enum StatusDataItem {
50    /// The number of messages in the mailbox.
51    Messages(u32),
52
53    /// The number of messages with the \Recent flag set.
54    Recent(u32),
55
56    /// The next unique identifier value of the mailbox.  Refer to
57    /// section 2.3.1.1 for more information.
58    UidNext(NonZeroU32),
59
60    /// The unique identifier validity value of the mailbox.  Refer to
61    /// section 2.3.1.1 for more information.
62    UidValidity(NonZeroU32),
63
64    /// The number of messages which do not have the \Seen flag set.
65    Unseen(u32),
66
67    /// The number of messages with the \Deleted flag set.
68    Deleted(u32),
69
70    /// The amount of storage space that can be reclaimed by performing EXPUNGE on the mailbox.
71    DeletedStorage(u64),
72}