timer: Replace Handle::deadline with Handle::timeout (#1074)

Deadline was deprecated a while ago and replaced with Timeout, but the
methods on Handle got missed.

Fixes #1071
This commit is contained in:
Steven Fackler
2019-04-30 10:29:54 -07:00
committed by Carl Lerche
parent ea282efb2e
commit 219f24cbf1
3 changed files with 12 additions and 3 deletions
+8 -2
View File
@@ -1,5 +1,5 @@
use timer::Inner;
use {Deadline, Delay, Error, Interval};
use {Deadline, Delay, Error, Interval, Timeout};
use tokio_executor::Enter;
@@ -139,11 +139,17 @@ impl Handle {
}
}
/// Create a `Deadline` driven by this handle's associated `Timer`.
#[doc(hidden)]
#[deprecated(since = "0.2.11", note = "use timeout instead")]
pub fn deadline<T>(&self, future: T, deadline: Instant) -> Deadline<T> {
Deadline::new_with_delay(future, self.delay(deadline))
}
/// Create a `Timeout` driven by this handle's associated `Timer`.
pub fn timeout<T>(&self, value: T, deadline: Instant) -> Timeout<T> {
Timeout::new_with_delay(value, self.delay(deadline))
}
/// Create a new `Interval` that starts at `at` and yields every `duration`
/// interval after that.
pub fn interval(&self, at: Instant, duration: Duration) -> Interval {