Impl MutableHookDataAccessor::access_mut() for Aspect
This commit is contained in:
parent
2022f4e4bb
commit
c4c02f2274
1 changed files with 12 additions and 1 deletions
|
@ -49,8 +49,19 @@ impl StoreIdAccessor for Aspect {
|
|||
|
||||
impl MutableHookDataAccessor for Aspect {
|
||||
fn access_mut(&self, fle: &mut FileLockEntry) -> HookResult<()> {
|
||||
let accessors : Vec<HDA> = self.hooks.iter().map(|h| h.accessor()).collect();
|
||||
if !accessors.iter().all(|a| match a { &HDA::MutableAccess(_) => true, _ => false }) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
for accessor in accessors {
|
||||
match accessor {
|
||||
HDA::MutableAccess(accessor) => try!(accessor.access_mut(fle)),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl NonMutableHookDataAccessor for Aspect {
|
||||
|
|
Loading…
Reference in a new issue