pub trait AsyncSleep: Debug + Send + Sync {
    // Required method
    fn sleep(&self, duration: Duration) -> Sleep ;
}
Expand description

Async trait with a sleep function.

Required Methods§

fn sleep(&self, duration: Duration) -> Sleep

Returns a future that sleeps for the given duration of time.

Trait Implementations§

§

impl AsRef<dyn AsyncSleep> for SharedAsyncSleep

§

fn as_ref(&self) -> &(dyn AsyncSleep + 'static)

Converts this type into a shared reference of the (usually inferred) input type.

Implementations on Foreign Types§

§

impl<T> AsyncSleep for Box<T, Global>where T: AsyncSleep + ?Sized,

§

fn sleep(&self, duration: Duration) -> Sleep

§

impl<T> AsyncSleep for Arc<T>where T: AsyncSleep + ?Sized,

§

fn sleep(&self, duration: Duration) -> Sleep

Implementors§

§

impl AsyncSleep for SharedAsyncSleep

§

impl AsyncSleep for TokioSleep