diff --git a/libimagstore/src/hook/aspect.rs b/libimagstore/src/hook/aspect.rs new file mode 100644 index 00000000..a5a2efaa --- /dev/null +++ b/libimagstore/src/hook/aspect.rs @@ -0,0 +1,49 @@ +use store::FileLockEntry; +use storeid::StoreId; +use hook::Hook; +use hook::result::HookResult; +use hook::accessor::{StoreIdAccessor, MutableHookDataAccessor, NonMutableHookDataAccessor}; + +#[derive(Debug)] +pub struct Aspect { + name: String, + hooks: Vec>, +} + +impl Aspect { + + pub fn new(name: String) -> Aspect { + Aspect { + name: name, + hooks: vec![], + } + } + + pub fn name(&self) -> &String { + &self.name + } + + pub fn register_hook(&mut self, h: Box) { + self.hooks.push(h); + } + +} + +impl StoreIdAccessor for Aspect { + fn access(&self, id: &StoreId) -> HookResult<()> { + unimplemented!() + } +} + +impl MutableHookDataAccessor for Aspect { + fn access_mut(&self, fle: &mut FileLockEntry) -> HookResult<()> { + unimplemented!() + } +} + +impl NonMutableHookDataAccessor for Aspect { + fn access(&self, fle: &FileLockEntry) -> HookResult<()> { + unimplemented!() + } +} + diff --git a/libimagstore/src/hook/mod.rs b/libimagstore/src/hook/mod.rs index 415f4ec4..43025591 100644 --- a/libimagstore/src/hook/mod.rs +++ b/libimagstore/src/hook/mod.rs @@ -6,6 +6,7 @@ use self::error::HookError; use store::FileLockEntry; pub mod accessor; +pub mod aspect; pub mod create; pub mod delete; pub mod error;