Can request new user password on login

This commit is contained in:
2022-04-02 08:30:01 +02:00
parent 0f4a5cde57
commit 4b8c9fdfdc
7 changed files with 222 additions and 11 deletions

View File

@@ -46,6 +46,17 @@ impl<E> EntityManager<E> where E: serde::Serialize + serde::de::DeserializeOwned
self.save()
}
/// Replace entries in the list that matches a criteria
pub fn replace_entries<F>(&mut self, filter: F, el: &E) -> Res where F: Fn(&E) -> bool {
for i in 0..self.list.len() {
if filter(&self.list[i]) {
self.list[i] = el.clone();
}
}
self.save()
}
/// Iterate over the entries of this entity manager
pub fn iter(&self) -> Iter<'_, E> {
self.list.iter()