Impl NonMutableHookDataAccessor::access() for Aspect
This commit is contained in:
parent
c4c02f2274
commit
d8760c9737
1 changed files with 12 additions and 1 deletions
|
@ -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(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue