aboutsummaryrefslogtreecommitdiff
path: root/src/uidindex.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/uidindex.rs')
-rw-r--r--src/uidindex.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/uidindex.rs b/src/uidindex.rs
index 9b85238..d78d8e4 100644
--- a/src/uidindex.rs
+++ b/src/uidindex.rs
@@ -164,6 +164,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>>;
impl FlagIndex {
fn new() -> Self {
@@ -182,9 +183,14 @@ impl FlagIndex {
self.0.get_mut(flag).and_then(|set| set.remove(&uid));
});
}
+
pub fn get(&self, f: &Flag) -> Option<&OrdSet<ImapUid>> {
self.0.get(f)
}
+
+ pub fn flags(&self) -> FlagIter {
+ self.0.keys()
+ }
}
// ---- CUSTOM SERIALIZATION AND DESERIALIZATION ----