Closed haraldh closed 2 years ago
Also, how about we add a platform()
getter on Handler
rather than passing it as argument?
Also, how about we add a
platform()
getter onHandler
rather than passing it as argument?
@rvolosatovs sadly, this won't work, because of Handler immutable self borrow and later for sally()
a mutable borrow.
Please rebase before merging
Previously the
validate_*
methods were giving out objects with an unbound lifetime.To ensure lifetimes don't outlive the real syscall, the caller of
Handler::syscall
now has to pass aPlatform
object, which binds the lifetimes of all objects generated by itsvalidate_*
methods to itsself.Also the
sally()
method is now part of theHandler
trait to decouple it from thePlatform
object, because it needs a mutable self.The implementation of the
Platform
object has to use internal mutablity to be able to hand out multiple mutable references.To be feature complete, the
Platform
trait would have to havedrop
methods for its internal bookkeeping. But doing so is a out of scope for this project for now.Signed-off-by: Harald Hoyer harald@profian.com