diff --git a/tokio-timer/src/delay.rs b/tokio-timer/src/delay.rs index 41210690e..7ba8be758 100644 --- a/tokio-timer/src/delay.rs +++ b/tokio-timer/src/delay.rs @@ -91,6 +91,13 @@ impl Delay { } } +#[cfg(feature = "async-traits")] +impl futures_core::FusedFuture for Delay { + fn is_terminated(&self) -> bool { + self.is_elapsed() + } +} + impl Future for Delay { type Output = (); diff --git a/tokio-timer/src/interval.rs b/tokio-timer/src/interval.rs index 31e003f21..ea5ca7d4a 100644 --- a/tokio-timer/src/interval.rs +++ b/tokio-timer/src/interval.rs @@ -100,6 +100,13 @@ impl Interval { } } +#[cfg(feature = "async-traits")] +impl futures_core::FusedStream for Interval { + fn is_terminated(&self) -> bool { + false + } +} + #[cfg(feature = "async-traits")] impl futures_core::Stream for Interval { type Item = Instant;