Add getter helper
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
cf78f7192f
commit
e86f36c215
1 changed files with 9 additions and 0 deletions
|
@ -58,6 +58,9 @@ pub trait EventStore<'a> {
|
||||||
-> Result<Vec<Result<FileLockEntry<'a>>>>
|
-> Result<Vec<Result<FileLockEntry<'a>>>>
|
||||||
where P: AsRef<Path>,
|
where P: AsRef<Path>,
|
||||||
Coll: AsRef<str>;
|
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 {
|
impl<'a> EventStore<'a> for Store {
|
||||||
|
@ -94,5 +97,11 @@ impl<'a> EventStore<'a> for Store {
|
||||||
})
|
})
|
||||||
.collect())
|
.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())?)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue