From d8760c97371d64463c7df953e4003e250591ff83 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 4 Mar 2016 21:20:13 +0100 Subject: [PATCH] Impl NonMutableHookDataAccessor::access() for Aspect --- libimagstore/src/hook/aspect.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libimagstore/src/hook/aspect.rs b/libimagstore/src/hook/aspect.rs index b77ca4d7..8d831de7 100644 --- a/libimagstore/src/hook/aspect.rs +++ b/libimagstore/src/hook/aspect.rs @@ -66,7 +66,18 @@ impl MutableHookDataAccessor for Aspect { impl NonMutableHookDataAccessor for Aspect { fn access(&self, fle: &FileLockEntry) -> HookResult<()> { - unimplemented!() + let accessors : Vec = self.hooks.iter().map(|h| h.accessor()).collect(); + if !accessors.iter().all(|a| match a { &HDA::NonMutableAccess(_) => true, _ => false }) { + unimplemented!() + } + + for accessor in accessors { + match accessor { + HDA::NonMutableAccess(accessor) => try!(accessor.access(fle)), + _ => unreachable!(), + } + } + Ok(()) } }