1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use core::{task, time}; use core::future::Future; use core::pin::Pin; ///Timer that never expires. pub struct NeverTimer; impl super::Oneshot for NeverTimer { fn new(_: time::Duration) -> Self { Self } fn cancel(&mut self) { } fn restart(&mut self, _: &time::Duration, _: &task::Waker) { } } impl Future for NeverTimer { type Output = (); fn poll(self: Pin<&mut Self>, _: &mut task::Context) -> task::Poll<Self::Output> { task::Poll::Pending } }