[−][src]Module drone_core::future
Asynchronous values.
This module provides the runtime for async
/await
feature. The runtime
relies on the Thread-Local Storage feature of Drone threads and
should be initialized with [future::init
]. There are two ways to use
async
/await
in Drone applications:
-
The preferred way is to use
libcore-drone
crate as a dependency. Place the following to the Cargo.toml:[dependencies] core = { package = "libcore-drone", version = "0.11.0" }
This way you can use native Rust
async
/await
syntax. -
Without
libcore-drone
, attempting to use.await
will result in the following errors:error[E0433]: failed to resolve: could not find `poll_with_tls_context` in `future` error[E0433]: failed to resolve: could not find `from_generator` in `future`
You can use [
future::fallback
] module instead. Refer the module documentation for examples.
Modules
fallback | Fallback syntax for |
Functions
from_generator | Wrap a generator in a future. |
init | Uses the thread-local storage of |
poll_with_context | Polls a future in the current task context. |