summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-09-28 11:21:06 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-10-09 19:44:08 +0200
commite86f36c215a43e7f0415e79eb9227adf56769d3e (patch)
tree39d3edddd5f17f88c0bf6d85bd78cf817a53c5d5
parentcf78f7192f4c880f10647f07c8197e9cac1010d8 (diff)
Add getter helper
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/domain/libimagcalendar/src/store.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/domain/libimagcalendar/src/store.rs b/lib/domain/libimagcalendar/src/store.rs
index 01880f51..656100e5 100644
--- a/lib/domain/libimagcalendar/src/store.rs
+++ b/lib/domain/libimagcalendar/src/store.rs
@@ -58,6 +58,9 @@ pub trait EventStore<'a> {
-> Result<Vec<Result<FileLockEntry<'a>>>>
where P: AsRef<Path>,
Coll: AsRef<str>;
+
+ fn get_event_by_uid<ID>(&'a self, id: ID) -> Result<Option<FileLockEntry<'a>>>
+ where ID: AsRef<str>;
}
impl<'a> EventStore<'a> for Store {
@@ -94,5 +97,11 @@ impl<'a> EventStore<'a> for Store {
})
.collect())
}
+
+ fn get_event_by_uid<ID>(&'a self, id: ID) -> Result<Option<FileLockEntry<'a>>>
+ where ID: AsRef<str>
+ {
+ self.get(crate::module_path::new_id(id.as_ref())?)
+ }
}