Impl NonMutableHookDataAccessor::access() for Aspect

This commit is contained in:
Matthias Beyer 2016-03-04 21:20:13 +01:00
parent c4c02f2274
commit d8760c9737

View file

@ -66,7 +66,18 @@ impl MutableHookDataAccessor for Aspect {
impl NonMutableHookDataAccessor for Aspect { impl NonMutableHookDataAccessor for Aspect {
fn access(&self, fle: &FileLockEntry) -> HookResult<()> { fn access(&self, fle: &FileLockEntry) -> HookResult<()> {
unimplemented!() let accessors : Vec<HDA> = 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(())
} }
} }