rtcompat: Expose a SleepFuture::reset
Tokio and Smol both have a method on their version of SleepFuture to change the expiration time without having to create a new future:
- https://docs.rs/tokio/latest/tokio/time/struct.Sleep.html#method.reset
- https://docs.rs/smol/latest/smol/struct.Timer.html#method.set_at
These functions don't change any wakers associated with the future, so they can be used to adjust time time conveniently.
I'd like to use this in the padding implementation, and it would be convenient to have it elsewhere too.
But before we add a method like this, we need to do a little work:
- If we're still supporting
async_std
, we need to emulate this behavior with a wrapper aroundasync_std
's timer code. - We need to emulate this in tor-rtmock.