aboutsummaryrefslogtreecommitdiff
path: root/src/mail/uidindex.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-29 12:50:44 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-29 12:50:44 +0200
commit90b143e1c57c6561998176878b2cc586b2d89c80 (patch)
treea9f07995d9d29e9f884756cad5732bfb2cbeb3fc /src/mail/uidindex.rs
parent9979671b001ccb25917da7091d13ad3fc1096330 (diff)
downloadaerogramme-90b143e1c57c6561998176878b2cc586b2d89c80.tar.gz
aerogramme-90b143e1c57c6561998176878b2cc586b2d89c80.zip
Refactor to allow mutability
Diffstat (limited to 'src/mail/uidindex.rs')
-rw-r--r--src/mail/uidindex.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mail/uidindex.rs b/src/mail/uidindex.rs
index ad27c1b..1e78d54 100644
--- a/src/mail/uidindex.rs
+++ b/src/mail/uidindex.rs
@@ -10,12 +10,12 @@ pub type ImapUid = NonZeroU32;
pub type ImapUidvalidity = NonZeroU32;
pub type Flag = String;
-#[derive(Clone)]
/// A UidIndex handles the mutable part of a mailbox
/// It is built by running the event log on it
/// Each applied log generates a new UidIndex by cloning the previous one
/// and applying the event. This is why we use immutable datastructures:
/// they are cheap to clone.
+#[derive(Clone)]
pub struct UidIndex {
// Source of trust
pub table: OrdMap<MailIdent, (ImapUid, Vec<Flag>)>,
@@ -162,6 +162,7 @@ impl BayouState for UidIndex {
}
// ---- FlagIndex implementation ----
+
#[derive(Clone)]
pub struct FlagIndex(HashMap<Flag, OrdSet<ImapUid>>);
pub type FlagIter<'a> = im::hashmap::Keys<'a, Flag, OrdSet<ImapUid>>;