Skip to main content

LocalAsyncDriver

Trait LocalAsyncDriver 

Source
pub trait LocalAsyncDriver {
    // Required methods
    fn sleep(
        &self,
        duration: Duration,
        callback: Box<dyn FnOnce()>,
    ) -> DriverCancel;
    fn interval(&self, period: Duration, callback: Rc<dyn Fn()>) -> DriverCancel;
    fn spawn_local(
        &self,
        fut: Pin<Box<dyn Future<Output = ()> + 'static>>,
    ) -> DriverCancel;
}
Expand description

Local, single-thread async/time driver.

No Send/Sync bounds: a graph is one single-thread concurrency domain (D22).

Required Methods§

Source

fn sleep(&self, duration: Duration, callback: Box<dyn FnOnce()>) -> DriverCancel

Updates or reads sleep.

Source

fn interval(&self, period: Duration, callback: Rc<dyn Fn()>) -> DriverCancel

Updates or reads interval.

Source

fn spawn_local( &self, fut: Pin<Box<dyn Future<Output = ()> + 'static>>, ) -> DriverCancel

Updates or reads spawn_local.

Implementors§

Source§

impl LocalAsyncDriver for TokioLocalDriver

Available on crate feature tokio only.