[][src]Trait tokio_global::AutoRuntime

pub trait AutoRuntime: Future {
    fn wait(self) -> Self::Output
    where
        Self: Send + Future + 'static,
        Self::Output: Send + 'static
;
fn spawn(self) -> JoinHandle<Self::Output>
    where
        Self: Send + Future + 'static,
        Self::Output: Send + 'static
; }

Trait to bootstrap your futures.

Required methods

fn wait(self) -> Self::Output where
    Self: Send + Future + 'static,
    Self::Output: Send + 'static, 

Blocks and waits for future to finish.

fn spawn(self) -> JoinHandle<Self::Output> where
    Self: Send + Future + 'static,
    Self::Output: Send + 'static, 

Spawns futures onto global runtime.

Note

Can be used in any context, but it requires future that returns nothing

Loading content...

Implementors

impl<F: Future> AutoRuntime for F[src]

Loading content...