Implement: execute_post_read_hooks()
This commit is contained in:
parent
09acddaef9
commit
196be30d91
1 changed files with 12 additions and 1 deletions
|
@ -415,7 +415,18 @@ impl Store {
|
||||||
pub fn execute_post_read_hooks<'a>(&'a self, fle: FileLockEntry<'a>)
|
pub fn execute_post_read_hooks<'a>(&'a self, fle: FileLockEntry<'a>)
|
||||||
-> Result<FileLockEntry<'a>>
|
-> Result<FileLockEntry<'a>>
|
||||||
{
|
{
|
||||||
unimplemented!()
|
self.post_read_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_read(f)))
|
||||||
|
.map_err(|e| {
|
||||||
|
StoreError::new(StoreErrorKind::PostHookExecuteError, Some(Box::new(e)))
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn execute_pre_create_hooks(&self, id: &StoreId) -> Result<()> {
|
pub fn execute_pre_create_hooks(&self, id: &StoreId) -> Result<()> {
|
||||||
|
|
Loading…
Reference in a new issue