pub struct TokioDefaultSpawner;
A spawner that delegates to tokio
's
DefaultExecutor
, will panic if used in
the context of a task that is not running on tokio
's executor.
NOTE The future of this struct in futures
is uncertain. It may be
deprecated before or soon after the initial 0.3 release and moved to a
feature in tokio
instead.
#![feature(async_await, await_macro, futures_api)]
use futures::future::{FutureExt, TryFutureExt};
use futures::spawn;
use futures::compat::TokioDefaultSpawner;
let future03 = async {
println!("Running on the pool");
spawn!(async {
println!("Spawned!");
}).unwrap();
};
let future01 = future03
.unit_error()
.boxed()
.compat(TokioDefaultSpawner);
tokio::run(future01);
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Spawns a future that will be run to completion. Read more
Determines whether the executor is able to spawn new tasks. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)