[][src]Trait tokio_compat_02::FutureExt

pub trait FutureExt: Future {
    pub fn compat(self) -> TokioContext<Self>

Notable traits for TokioContext<F>

impl<F: Future> Future for TokioContext<F> type Output = F::Output;

    where
        Self: Sized
; }

Trait extension that simplifies bundling a Handle with a Future.

Required methods

pub fn compat(self) -> TokioContext<Self>

Notable traits for TokioContext<F>

impl<F: Future> Future for TokioContext<F> type Output = F::Output;
where
    Self: Sized
[src]

Compat any future into a future that can run within the Tokio 0.2 context.

This will spawn single threaded scheduler in the background globally to allow you to call this extension trait method from anywhere. The background scheduler supports running Tokio 0.2 futures in any context with a small footprint.

Example

use tokio_compat_02::FutureExt as _;

my_future().compat().await;
Loading content...

Implementors

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

Loading content...