Profiles: Add 'all-profiles' iterator

This commit is contained in:
asonix 2021-01-24 22:07:11 -06:00
parent deca730bf7
commit acdf7e69fa

View file

@ -284,6 +284,18 @@ impl Store {
})
}
pub fn all(&self) -> impl DoubleEndedIterator<Item = Uuid> {
self.owner_created_tree
.iter()
.values()
.filter_map(|res| res.ok())
.filter_map(|ivec| {
let id_str = String::from_utf8_lossy(&ivec);
id_str.parse().ok()
})
.rev()
}
pub fn newer_than(&self, id: Uuid) -> impl DoubleEndedIterator<Item = Uuid> {
let this = self.clone();