diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-03-19 19:21:33 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-03-25 16:30:12 +0100 |
commit | 831ff84b74b475c0297b47aecdf5270c3457a837 (patch) | |
tree | 1d96ac4daf4a3b663a224cf08f16b585d53ee4bc | |
parent | 3a7c153f21211eb1751ac673b2407622a9274b20 (diff) |
lib: Add Note::retrieve()
-rw-r--r-- | libimagnotes/src/note.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libimagnotes/src/note.rs b/libimagnotes/src/note.rs index 249f4591..5105f7bc 100644 --- a/libimagnotes/src/note.rs +++ b/libimagnotes/src/note.rs @@ -86,6 +86,12 @@ impl<'a> Note<'a> { .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> { |