mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
Add a method to reset Timeout.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user