diff --git a/libimagstore/src/hook/accessor.rs b/libimagstore/src/hook/accessor.rs index 88c8153b..e9d39915 100644 --- a/libimagstore/src/hook/accessor.rs +++ b/libimagstore/src/hook/accessor.rs @@ -1,19 +1,22 @@ +use std::fmt::Debug; + use hook::result::HookResult; use store::FileLockEntry; use storeid::StoreId; -pub trait StoreIdAccessor : Send + Sync { +pub trait StoreIdAccessor : Debug + Send + Sync { fn access(&self, &StoreId) -> HookResult<()>; } -pub trait MutableHookDataAccessor : Send + Sync { +pub trait MutableHookDataAccessor : Debug + Send + Sync { fn access_mut(&self, &mut FileLockEntry) -> HookResult<()>; } -pub trait NonMutableHookDataAccessor : Send + Sync { +pub trait NonMutableHookDataAccessor : Debug + Send + Sync { fn access(&self, &FileLockEntry) -> HookResult<()>; } +#[derive(Debug)] pub enum HookDataAccessor<'a> { StoreIdAccess(&'a StoreIdAccessor), MutableAccess(&'a MutableHookDataAccessor), diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index b3408a16..8af9519e 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -372,7 +372,7 @@ impl Store { }) .map(|e| FileLockEntry::new(self, e, id)) .and_then(|mut fle| { - self.execute_hooks_for_mut_file(self.pre_retrieve_aspects.clone(), &mut fle) + self.execute_hooks_for_mut_file(self.post_retrieve_aspects.clone(), &mut fle) .map_err(|e| SE::new(SEK::HookExecutionError, Some(Box::new(e)))) .and(Ok(fle)) })