From 831ff84b74b475c0297b47aecdf5270c3457a837 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 19 Mar 2016 19:21:33 +0100 Subject: [PATCH] lib: Add Note::retrieve() --- libimagnotes/src/note.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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 { + 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> {