sunriseos / SunriseOS

Horizon/NX kernel reimplementation
Apache License 2.0
232 stars 13 forks source link

Unify Handle/HandleRef behind a single trait. #493

Open todo[bot] opened 5 years ago

todo[bot] commented 5 years ago

The fact I have to do this makes me think there's really a problem in the handle/handleref design. Maybe there should be a trait unifying Handle/HandleRef, and `Process` and co should be generic on those? That would allow me to call the functions on "borrowed lifetime-erased" handles. This trait could probably be AsRef or Borrow. Ideally the generic types would be an internal implementation details and we'd just expose "Process" and "ProcessBorrowed" types through typedef/newtypes. Needs a lot of thought.


https://github.com/sunriseos/SunriseOS/blob/7651488b2571309009bcc76fb79c2ec52bea9cc4/loader/src/main.rs#L222-L232


This issue was generated by todo based on a TODO comment in 7651488b2571309009bcc76fb79c2ec52bea9cc4 when #488 was merged. cc @roblabla.