diff --git a/src/reactor/timeout.rs b/src/reactor/timeout.rs index 76fba9fd4..604dccca0 100644 --- a/src/reactor/timeout.rs +++ b/src/reactor/timeout.rs @@ -46,6 +46,13 @@ impl Timeout { handle: handle.remote().clone(), }) } + + /// Resets this timeout to an new timeout which will fire at the time + /// specified by `at`. + pub fn reset(&mut self, at: Instant) { + self.when = at; + self.token.reset_timeout(self.when, &self.handle); + } } impl Future for Timeout {