Timer

Trait Timer 

Source
pub trait Timer {
    // Required method
    fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>;
}
Expand description

Represents the fact that an executor has timer functionality.

Required Methods§

Source

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Future that resolves after a given duration.

Implementations on Foreign Types§

Source§

impl<T: Timer + ?Sized> Timer for &T

Source§

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Source§

impl<T: Timer + ?Sized> Timer for &mut T

Source§

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Source§

impl<T: Timer + ?Sized> Timer for Rc<T>

Source§

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Source§

impl<T: Timer + ?Sized> Timer for Arc<T>

Source§

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Source§

impl<T: Timer> Timer for Box<T>

Source§

fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>

Implementors§

Source§

impl Timer for TokioTp

Available on crate features tokio_timer and tokio_tp only.