diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-29 12:50:44 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-29 12:50:44 +0200 |
commit | 90b143e1c57c6561998176878b2cc586b2d89c80 (patch) | |
tree | a9f07995d9d29e9f884756cad5732bfb2cbeb3fc /src/mail/uidindex.rs | |
parent | 9979671b001ccb25917da7091d13ad3fc1096330 (diff) | |
download | aerogramme-90b143e1c57c6561998176878b2cc586b2d89c80.tar.gz aerogramme-90b143e1c57c6561998176878b2cc586b2d89c80.zip |
Refactor to allow mutability
Diffstat (limited to 'src/mail/uidindex.rs')
-rw-r--r-- | src/mail/uidindex.rs | 3 |
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>>; |