Implement: execute_post_create_hooks()

This commit is contained in:
Matthias Beyer 2016-02-17 16:01:20 +01:00
parent 196be30d91
commit 5831d3bc7b

View file

@ -441,7 +441,18 @@ impl Store {
pub fn execute_post_create_hooks<'a>(&'a self, fle: FileLockEntry<'a>) pub fn execute_post_create_hooks<'a>(&'a self, fle: FileLockEntry<'a>)
-> Result<FileLockEntry<'a>> -> Result<FileLockEntry<'a>>
{ {
unimplemented!() self.post_create_hooks
.deref()
.lock()
.map_err(|e| StoreError::new(StoreErrorKind::PostHookExecuteError, None))
.and_then(|guard| {
guard.deref()
.iter()
.fold(Ok(fle), move |file, hook| file.and_then(|f| hook.post_create(f)))
.map_err(|e| {
StoreError::new(StoreErrorKind::PostHookExecuteError, Some(Box::new(e)))
})
})
} }
pub fn execute_pre_retrieve_hooks(&self, id: &StoreId) -> Result<()> { pub fn execute_pre_retrieve_hooks(&self, id: &StoreId) -> Result<()> {