In Future’s poll() method, you get a borrow of Context. You’re supposed to call Context.waker (https://docs.rs/futures/0.2.0/futures/task/struct.Context.html#method.waker) when the future is ready with data. But how do you get the waker out of the poll() method. I’d like to store it in another structure (with a different lifetime) with more knowledge of whether we’re ready to return data.
If you try to add lifetimes to anything in the poll() method, rust complains that the method signature no longer matches Future’s poll method. If you don’t, rust complains that the anonymous lifetime of the poll method doesn’t live long enough.