Sha256: 1e118a365fd532bf84d4e27714d3c0f133e247a731bcd9840ab6d6e8b737fb6a
Contents?: true
Size: 1.04 KB
Versions: 39
Compression:
Stored size: 1.04 KB
Contents
//! Dummy Timer use core::{task, time}; use core::future::Future; use core::pin::Pin; ///Dummy Timer with implementation that panics pub struct DummyTimer; impl DummyTimer { ///Creates new instance pub const fn new(_: time::Duration) -> Self { Self } } impl super::Timer for DummyTimer { fn new(_: time::Duration) -> Self { unimplemented!(); } fn is_ticking(&self) -> bool { false } fn is_expired(&self) -> bool { false } fn cancel(&mut self) { unimplemented!(); } fn restart(&mut self, _: time::Duration) { unimplemented!(); } fn restart_ctx(&mut self, _: time::Duration, _: &task::Waker) { unimplemented!(); } } impl super::SyncTimer for DummyTimer { fn init<R, F: Fn(&crate::state::TimerState) -> R>(&mut self, _: F) -> R { unimplemented!(); } } impl Future for DummyTimer { type Output = (); fn poll(self: Pin<&mut Self>, _: &mut task::Context) -> task::Poll<Self::Output> { unimplemented!(); } }
Version data entries
39 entries across 39 versions & 1 rubygems