Doc for Store::retrieve()

This commit is contained in:
Matthias Beyer 2017-02-20 16:03:24 +01:00
parent 8896bbb4c5
commit 8867e50618

View file

@ -479,6 +479,24 @@ impl Store {
/// ///
/// Implicitely creates a entry in the store if there is no entry with the id `id`. For a /// Implicitely creates a entry in the store if there is no entry with the id `id`. For a
/// non-implicitely-create look at `Store::get`. /// non-implicitely-create look at `Store::get`.
///
/// # Executed Hooks
///
/// - Pre retrieve aspects
/// - post retrieve aspects
///
/// # Return value
///
/// On success: FileLockEntry
///
/// On error:
/// - Errors StoreId::into_storeid() might return
/// - RetrieveCallError(HookExecutionError(PreHookExecuteError(_)))
/// of the first failing pre hook.
/// - RetrieveCallError(HookExecutionError(PostHookExecuteError(_)))
/// of the first failing post hook.
/// - RetrieveCallError(LockPoisoned()) if the internal lock is poisened.
///
pub fn retrieve<'a, S: IntoStoreId>(&'a self, id: S) -> Result<FileLockEntry<'a>> { pub fn retrieve<'a, S: IntoStoreId>(&'a self, id: S) -> Result<FileLockEntry<'a>> {
let id = try!(id.into_storeid()).with_base(self.path().clone()); let id = try!(id.into_storeid()).with_base(self.path().clone());
if let Err(e) = self.execute_hooks_for_id(self.pre_retrieve_aspects.clone(), &id) { if let Err(e) = self.execute_hooks_for_id(self.pre_retrieve_aspects.clone(), &id) {