Module pyo3_asyncio::tokio
source · Expand description
tokio-runtime PyO3 Asyncio functions specific to the tokio runtime
Items marked with
unstable-streams
are only available when the unstable-streams Cargo feature is enabled:
[dependencies.pyo3-asyncio]
version = "0.20"
features = ["unstable-streams"]
Modules
attributesre-exports for macros
Functions
- Convert a Rust Future into a Python awaitable
- Convert a Rust Future into a Python awaitable
- Either copy the task locals from the current task OR get the current running loop and contextvars from Python.
- Get the current event loop from either Python or Rust async task local context
- Get a reference to the current tokio runtime
- Initialize the Tokio runtime with a custom build
- Initialize the Tokio runtime with a custom Tokio runtime
- Convert a Python
awaitableinto a Rust Future unstable-streamsConvert an async generator into a streamunstable-streamsConvert an async generator into a streamunstable-streamsConvert an async generator into a streamunstable-streamsConvert an async generator into a stream- local_future_into_pyDeprecatedConvert a
!SendRust Future into a Python awaitable - local_future_into_py_with_localsDeprecatedConvert a
!SendRust Future into a Python awaitable - Run the event loop until the given Future completes
- Run the event loop until the given Future completes
- Set the task local event loop for the given future
- Set the task local event loop for the given !Send future
Attribute Macros
attributesEnables an async main function that uses the tokio runtime.attributestestingRegisters atokiotest with thepyo3-asynciotest harness Registers atokiotest with thepyo3-asynciotest harness.