From 12e07b32d4d1e18fdae22b72b513b56f2f37f8ed Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 15:17:55 +0100 Subject: [PATCH 01/18] Add documentation for store functions --- libimagstore/src/store.rs | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index d245feb3..455b3a95 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -758,6 +758,21 @@ impl Store { &self.location } + /// Register a hook in the store. + /// + /// A hook is registered by a position (when should the hook be executed) and an aspect name. + /// The aspect name must be in the configuration file, so the configuration for the hook can be + /// passed to the `Hook` object. + /// + /// # Available Hook positions + /// + /// The hook positions are described in the type description of `HookPosition`. + /// + /// # Aspect names + /// + /// Aspect names are arbitrary, though sane things like "debug" or "vcs" are encouraged. + /// Refer to the documentation for more information. + /// pub fn register_hook(&mut self, position: HookPosition, aspect_name: &str, @@ -800,6 +815,7 @@ impl Store { Err(SEK::HookRegisterError.into_error_with_cause(Box::new(annfe))) } + /// Get the configuration for a hook by the name of the hook, from the configuration file. fn get_config_for_hook(&self, name: &str) -> Option<&Value> { match self.configuration { Some(Value::Table(ref tabl)) => { @@ -819,6 +835,7 @@ impl Store { } } + /// Execute all hooks from all aspects for a Store Id object. fn execute_hooks_for_id(&self, aspects: Arc>>, id: &StoreId) @@ -834,6 +851,7 @@ impl Store { .map_err(|e| HookErrorKind::HookExecutionError.into_error_with_cause(e)) } + /// Execute all hooks from all aspects for a mutable `FileLockEntry` object. fn execute_hooks_for_mut_file(&self, aspects: Arc>>, fle: &mut FileLockEntry) @@ -853,6 +871,7 @@ impl Store { impl Debug for Store { + /// TODO: Make pretty. fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FMTError> { try!(write!(fmt, " --- Store ---\n")); try!(write!(fmt, "\n")); @@ -877,11 +896,12 @@ impl Debug for Store { impl Drop for Store { - /** - * Unlock all files on drop - * - * TODO: Unlock them - */ + /// + /// Unlock all files on drop + // + /// TODO: Unlock them + /// TODO: Resolve this dirty hack with the StoreId for the Store drop hooks. + /// fn drop(&mut self) { match StoreId::new(Some(self.location.clone()), PathBuf::from(".")) { Err(e) => { From 356c17d98b6ef899b2368a8807eeee258f81a27d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 15:18:08 +0100 Subject: [PATCH 02/18] Add documentation for FileLockEntry --- libimagstore/src/store.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 455b3a95..8472ad91 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -929,6 +929,10 @@ pub struct FileLockEntry<'a> { } impl<'a> FileLockEntry<'a, > { + + /// Create a new FileLockEntry based on a `Entry` object. + /// + /// Only for internal use. fn new(store: &'a Store, entry: Entry) -> FileLockEntry<'a> { FileLockEntry { store: store, @@ -960,7 +964,11 @@ impl<'a> DerefMut for FileLockEntry<'a> { #[cfg(not(test))] impl<'a> Drop for FileLockEntry<'a> { + /// This will silently ignore errors, use `Store::update` if you want to catch the errors + /// + /// This might panic if the store was compiled with the early-panic feature (which is not + /// intended for production use, though). fn drop(&mut self) { use libimagerror::trace::trace_error_dbg; From 93ca8f704655ea42248efac0597728f89ee04d2d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 15:18:19 +0100 Subject: [PATCH 03/18] Add documentation for Entry type --- libimagstore/src/store.rs | 44 ++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 8472ad91..80b9ecec 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -984,21 +984,21 @@ impl<'a> Drop for FileLockEntry<'a> { #[cfg(test)] impl<'a> Drop for FileLockEntry<'a> { + /// This will not silently ignore errors but prints the result of the _update() call for testing fn drop(&mut self) { let _ = self.store._update(self, true).map_err(|e| trace_error(&e)); } + } /// `EntryContent` type pub type EntryContent = String; -/** - * An Entry of the store - * - * Contains location, header and content part. - */ +/// An Entry of the store +// +/// Contains location, header and content part. #[derive(Debug, Clone)] pub struct Entry { location: StoreId, @@ -1008,6 +1008,10 @@ pub struct Entry { impl Entry { + /// Create a new store entry with its location at `loc`. + /// + /// This creates the entry with the default header from `Entry::default_header()` and an empty + /// content. pub fn new(loc: StoreId) -> Entry { Entry { location: loc, @@ -1016,10 +1020,16 @@ impl Entry { } } + /// Get the default Header for an Entry. + /// + /// This function should be used to get a new Header, as the default header may change. Via + /// this function, compatibility is ensured. pub fn default_header() -> Value { // BTreeMap Value::default_header() } + /// See `Entry::from_str()`, as this function is used internally. This is just a wrapper for + /// convenience. pub fn from_reader(loc: S, file: &mut Read) -> Result { let text = { let mut s = String::new(); @@ -1029,6 +1039,18 @@ impl Entry { Self::from_str(loc, &text[..]) } + /// Create a new Entry, with contents from the string passed. + /// + /// The passed string _must_ be a complete valid store entry, including header. So this is + /// probably not what end-users want to call. + /// + /// # Return value + /// + /// This errors if + /// + /// - String cannot be matched on regex to find header and content + /// - Header cannot be parsed into a TOML object + /// pub fn from_str(loc: S, s: &str) -> Result { debug!("Building entry from string"); lazy_static! { @@ -1060,32 +1082,44 @@ impl Entry { }) } + /// Return the string representation of this entry + /// + /// This means not only the content of the entry, but the complete entry (from memory, not from + /// disk). pub fn to_str(&self) -> String { format!("---\n{header}---\n{content}", header = ::toml::encode_str(&self.header), content = self.content) } + /// Get the location of the Entry pub fn get_location(&self) -> &StoreId { &self.location } + /// Get the header of the Entry pub fn get_header(&self) -> &Value { &self.header } + /// Get the header mutably of the Entry pub fn get_header_mut(&mut self) -> &mut Value { &mut self.header } + /// Get the content of the Entry pub fn get_content(&self) -> &EntryContent { &self.content } + /// Get the content mutably of the Entry pub fn get_content_mut(&mut self) -> &mut EntryContent { &mut self.content } + /// Verify the entry. + /// + /// Currently, this only verifies the header. This might change in the future. pub fn verify(&self) -> Result<()> { self.header.verify() } From e26a23420a498aae51efea0d4b2ef586a02d1a5e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:02:49 +0100 Subject: [PATCH 04/18] Doc for Store object type --- libimagstore/src/store.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 80b9ecec..9aab9d7f 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -190,14 +190,14 @@ impl StoreEntry { pub struct Store { location: PathBuf, - /** - * Configuration object of the store - */ + /// + /// Configuration object of the store + /// configuration: Option, - /* - * Registered hooks - */ + // + // Registered hooks + // store_unload_aspects : Arc>>, From 84dc3857498c3824628e8c96df8a1d8e46acb94c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:03:03 +0100 Subject: [PATCH 05/18] Doc for Store::new() --- libimagstore/src/store.rs | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 9aab9d7f..8d05da9d 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -212,19 +212,42 @@ pub struct Store { pre_move_aspects : Arc>>, post_move_aspects : Arc>>, - /** - * Internal Path->File cache map - * - * Caches the files, so they remain flock()ed - * - * Could be optimized for a threadsafe HashMap - */ + /// + /// Internal Path->File cache map + /// + /// Caches the files, so they remain flock()ed + /// + /// Could be optimized for a threadsafe HashMap + /// entries: Arc>>, } impl Store { /// Create a new Store object + /// + /// This opens a Store in `location` using the configuration from `store_config` (if absent, it + /// uses defaults). + /// + /// If the configuration is not valid, this fails. + /// + /// If the location does not exist, creating directories is by default denied and the operation + /// fails, if not configured otherwise. + /// An error is returned in this case. + /// + /// If the path exists and is a file, the operation is aborted as well, an error is returned. + /// + /// After that, the store hook aspects are created and registered in the store. + /// + /// # Return values + /// + /// - On success: Store object + /// - On Failure: + /// - ConfigurationError if config is faulty + /// - IoError(FileError(CreateStoreDirDenied())) if store location does not exist and creating + /// is denied + /// - StorePathCreate(_) if creating the store directory failed + /// - StorePathExists() if location exists but is a file pub fn new(location: PathBuf, store_config: Option) -> Result { use configuration::*; From 8896bbb4c5c89458312d7baab7f3a3499a9175c2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:03:11 +0100 Subject: [PATCH 06/18] Doc for Store::create() --- libimagstore/src/store.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 8d05da9d..fc2a730d 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -422,6 +422,25 @@ impl Store { } /// Creates the Entry at the given location (inside the entry) + /// + /// # Executed Hooks + /// + /// - Pre create aspects + /// - post create aspects + /// + /// # Return value + /// + /// On success: FileLockEntry + /// + /// On error: + /// - Errors StoreId::into_storeid() might return + /// - CreateCallError(HookExecutionError(PreHookExecuteError(_))) + /// of the first failing pre hook. + /// - CreateCallError(HookExecutionError(PostHookExecuteError(_))) + /// of the first failing post hook. + /// - CreateCallError(LockPoisoned()) if the internal lock is poisened. + /// - CreateCallError(EntryAlreadyExists()) if the entry exists already. + /// pub fn create<'a, S: IntoStoreId>(&'a self, id: S) -> Result> { let id = try!(id.into_storeid()).with_base(self.path().clone()); if let Err(e) = self.execute_hooks_for_id(self.pre_create_aspects.clone(), &id) { From 8867e50618c46edf00d72cb75064e5b0ffb9935a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:03:24 +0100 Subject: [PATCH 07/18] Doc for Store::retrieve() --- libimagstore/src/store.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index fc2a730d..9ad5d8ef 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -479,6 +479,24 @@ impl Store { /// /// 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`. + /// + /// # 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> { 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) { From 4e042e4de25868212f8909875e5df5e9773a5369 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:03:32 +0100 Subject: [PATCH 08/18] Doc for Store::get() --- libimagstore/src/store.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 9ad5d8ef..e11cf754 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -530,7 +530,19 @@ impl Store { /// Get an entry from the store if it exists. /// - /// This executes the {pre,post}_retrieve_aspects hooks. + /// # Executed Hooks + /// + /// - Pre get aspects + /// - post get aspects + /// + /// # Return value + /// + /// On success: Some(FileLockEntry) or None + /// + /// On error: + /// - Errors StoreId::into_storeid() might return + /// - Errors Store::retrieve() might return + /// pub fn get<'a, S: IntoStoreId + Clone>(&'a self, id: S) -> Result>> { let id = try!(id.into_storeid()).with_base(self.path().clone()); From 8d855f4c78d551a439ef5ea7a50c4aeb87897728 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:03:45 +0100 Subject: [PATCH 09/18] Doc for Store::retrieve_for_module() --- libimagstore/src/store.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index e11cf754..8312cc7f 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -562,6 +562,16 @@ impl Store { } /// Iterate over all StoreIds for one module name + /// + /// # Returns + /// + /// On success: An iterator over all entries in the module + /// + /// On failure: + /// - RetrieveForModuleCallError(GlobError(EncodingError())) if the path string cannot be + /// encoded + /// - GRetrieveForModuleCallError(GlobError(lobError())) if the glob() failed. + /// pub fn retrieve_for_module(&self, mod_name: &str) -> Result { let mut path = self.path().clone(); path.push(mod_name); From 77b10e20cb02fd83cd98cc481d3625426da0dbaf Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:03:56 +0100 Subject: [PATCH 10/18] Doc for Store::walk() --- libimagstore/src/store.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 8312cc7f..419a96f2 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -588,7 +588,10 @@ impl Store { .map_err_into(SEK::RetrieveForModuleCallError) } - // Walk the store tree for the module + /// Walk the store tree for the module + /// + /// The difference between a `Walk` and a `StoreIdIterator` is that with a `Walk`, one can find + /// "collections" (folders). pub fn walk<'a>(&'a self, mod_name: &str) -> Walk { Walk::new(self.path().clone(), mod_name) } From c8c8401680194d7a849c03593c330c0326624fa9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:04:04 +0100 Subject: [PATCH 11/18] Doc for Store::update() --- libimagstore/src/store.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 419a96f2..c0e6410a 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -597,6 +597,9 @@ impl Store { } /// Return the `FileLockEntry` and write to disk + /// + /// See `Store::_update()`. + /// pub fn update<'a>(&'a self, mut entry: FileLockEntry<'a>) -> Result<()> { self._update(&mut entry, false).map_err_into(SEK::UpdateCallError) } From 1f47db39511608dd9971140cc7dc28cf2333f05a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:04:17 +0100 Subject: [PATCH 12/18] Doc for Store::_update() --- libimagstore/src/store.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index c0e6410a..a56dc198 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -607,8 +607,29 @@ impl Store { /// Internal method to write to the filesystem store. /// /// # Assumptions + /// /// This method assumes that entry is dropped _right after_ the call, hence /// it is not public. + /// + /// # Executed Hooks + /// + /// - Pre update aspects + /// - post update aspects + /// + /// # Return value + /// + /// On success: Entry + /// + /// On error: + /// - UpdateCallError(HookExecutionError(PreHookExecuteError(_))) + /// of the first failing pre hook. + /// - UpdateCallError(HookExecutionError(PostHookExecuteError(_))) + /// of the first failing post hook. + /// - UpdateCallError(LockPoisoned()) if the internal write lock cannot be aquierd. + /// - IdNotFound() if the entry was not found in the stor + /// - Errors Entry::verify() might return + /// - Errors StoreEntry::write_entry() might return + /// fn _update<'a>(&'a self, mut entry: &mut FileLockEntry<'a>, modify_presence: bool) -> Result<()> { let _ = try!(self.execute_hooks_for_mut_file(self.pre_update_aspects.clone(), &mut entry) .map_err_into(SEK::PreHookExecuteError) @@ -634,7 +655,6 @@ impl Store { se.status = StoreEntryStatus::Present; } - self.execute_hooks_for_mut_file(self.post_update_aspects.clone(), &mut entry) .map_err_into(SEK::PostHookExecuteError) .map_err_into(SEK::HookExecutionError) From c82d7bf7bcfa20ad9cf8b8cbcaa28eed90d57a26 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:04:28 +0100 Subject: [PATCH 13/18] Doc for Store::retrieve_copy() --- libimagstore/src/store.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index a56dc198..c9b5f1a7 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -663,6 +663,22 @@ impl Store { /// Retrieve a copy of a given entry, this cannot be used to mutate /// the one on disk + /// + /// TODO: Create Hooks for retrieving a copy + /// + /// # Executed Hooks + /// + /// - (none yet) + /// + /// # Return value + /// + /// On success: Entry + /// + /// On error: + /// - RetrieveCopyCallError(LockPoisoned()) if the internal write lock cannot be aquierd. + /// - RetrieveCopyCallError(IdLocked()) if the Entry is borrowed currently + /// - Errors StoreEntry::new() might return + /// pub fn retrieve_copy(&self, id: S) -> Result { let id = try!(id.into_storeid()).with_base(self.path().clone()); let entries = match self.entries.write() { From f1293589992a02497b52b492af3da5fd1033f1cf Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:04:36 +0100 Subject: [PATCH 14/18] Doc for Store::delete() --- libimagstore/src/store.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index c9b5f1a7..a1ac356a 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -698,6 +698,25 @@ impl Store { } /// Delete an entry + /// + /// # Executed Hooks + /// + /// - Pre delete aspects, if the id can be used + /// - Post delete aspects, if the operation succeeded + /// + /// # Return value + /// + /// On success: () + /// + /// On error: + /// - DeleteCallError(HookExecutionError(PreHookExecuteError(_))) + /// of the first failing pre hook. + /// - DeleteCallError(HookExecutionError(PostHookExecuteError(_))) + /// of the first failing post hook. + /// - DeleteCallError(LockPoisoned()) if the internal write lock cannot be aquierd. + /// - DeleteCallError(FileNotFound()) if the StoreId refers to a non-existing entry. + /// - DeleteCallError(FileError()) if the internals failed to remove the file. + /// pub fn delete(&self, id: S) -> Result<()> { let id = try!(id.into_storeid()).with_base(self.path().clone()); if let Err(e) = self.execute_hooks_for_id(self.pre_delete_aspects.clone(), &id) { From 671f19043d72dd1debbdc8b9a10a488371f20e68 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:04:49 +0100 Subject: [PATCH 15/18] Doc for Store::save_to() --- libimagstore/src/store.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index a1ac356a..1dadcd9c 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -760,6 +760,8 @@ impl Store { /// Save a copy of the Entry in another place /// Executes the post_move_aspects for the new id + /// + /// TODO: Introduce new aspect for `save_to()`. pub fn save_to(&self, entry: &FileLockEntry, new_id: StoreId) -> Result<()> { self.save_to_other_location(entry, new_id, false) } From 77d5fcc2d02f60a8d56a2cacf738c45f391f3e8e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:04:54 +0100 Subject: [PATCH 16/18] Doc for Store::save_as() --- libimagstore/src/store.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 1dadcd9c..b622acaa 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -769,6 +769,8 @@ impl Store { /// Save an Entry in another place /// Removes the original entry /// Executes the post_move_aspects for the new id + /// + /// TODO: Introduce new aspect for `save_as()`. pub fn save_as(&self, entry: FileLockEntry, new_id: StoreId) -> Result<()> { self.save_to_other_location(&entry, new_id, true) } From 0c3cea692fc72f2993ef7e1b2f3e156f6231d104 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:05:07 +0100 Subject: [PATCH 17/18] Doc for Store::execute_hooks_for_id() --- libimagstore/src/store.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index b622acaa..a347d07b 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -983,6 +983,12 @@ impl Store { } /// Execute all hooks from all aspects for a Store Id object. + /// + /// # Return value + /// + /// - () on success + /// - Error on the first failing hook. + /// fn execute_hooks_for_id(&self, aspects: Arc>>, id: &StoreId) From 602bdd9762479e40101afa6c1547d577256abd7a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 20 Feb 2017 16:05:17 +0100 Subject: [PATCH 18/18] Doc for Store::execute_hooks_for_mut_file() --- libimagstore/src/store.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index a347d07b..e90750ad 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -1005,6 +1005,12 @@ impl Store { } /// Execute all hooks from all aspects for a mutable `FileLockEntry` object. + /// + /// # Return value + /// + /// - () on success + /// - Error on the first failing hook. + /// fn execute_hooks_for_mut_file(&self, aspects: Arc>>, fle: &mut FileLockEntry)