lib: Add Note::retrieve()

This commit is contained in:
Matthias Beyer 2016-03-19 19:21:33 +01:00
parent 3a7c153f21
commit 831ff84b74

View file

@ -86,6 +86,12 @@ impl<'a> Note<'a> {
.map_err(|e| NE::new(NEK::StoreWriteError, Some(Box::new(e)))) .map_err(|e| NE::new(NEK::StoreWriteError, Some(Box::new(e))))
} }
pub fn retrieve(store: &Store, name: String) -> Result<Note> {
store.retrieve(ModuleEntryPath::new(name).into_storeid())
.map_err(|e| NE::new(NEK::StoreWriteError, Some(Box::new(e))))
.map(|entry| Note { entry: entry })
}
} }
impl<'a> Tagable for Note<'a> { impl<'a> Tagable for Note<'a> {