Trait odbc_api::Sleep

source ·
pub trait Sleep {
    type Poll: Future;

    // Required method
    fn next_poll(&mut self) -> Self::Poll;
}
Expand description

Governs the behaviour of of polling in async functions.

There is a generic implementation for any function retuning a future. This allows e.g. to pass || tokio::time::sleep(Duration::from_millis(50)) to functions expecting sleep. That is if you use tokio as your async runtime, of course.

Required Associated Types§

Required Methods§

source

fn next_poll(&mut self) -> Self::Poll

Between each poll next poll is executed, and the resulting future is awaited.

Implementors§

source§

impl<S, F> Sleep for Swhere S: FnMut() -> F, F: Future,

§

type Poll = F