Okay I`ll take a look at the rental crate.
I do not know what you mean by just storing the device in the context. That`s exactly how I had done it before (I think?).
The problem is, that I am moving a device into the static closure (via a Rc), but the device still has a reference with a not static lifetime bound to the API outside the closure, so that wont work.
I also already tried to put both the API and device behind Rc`s, and move them both inside the closure, but because I instantiated the device before, the compiler can not really figure out, that the reference will stay valid (because the Rc owned by the closure will gurantee the API lifetime over the lifetime of the closure).