Module generic

Source
Expand description

Generic implementations of PyO3 Asyncio utilities that can be used for any Rust runtime

Items marked with <span class=“module-item stab portability” style=“display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;”

unstable-streams are only available when the unstable-streams Cargo feature is enabled:

[dependencies.pyo3-asyncio]
version = "0.20"
features = ["unstable-streams"]

Traits§

ContextExt
Exposes the utilities necessary for using task-local data in the Runtime
JoinError
Generic utilities for a JoinError
LocalContextExt
Adds the ability to scope task-local data for !Send futures
Runtime
Generic Rust async/await runtime
SpawnLocalExt
Extension trait for async/await runtimes that support spawning local tasks

Functions§

future_into_py
Convert a Rust Future into a Python awaitable with a generic runtime
future_into_py_with_locals
Convert a Rust Future into a Python awaitable with a generic runtime
get_current_locals
Either copy the task locals from the current task OR get the current running loop and contextvars from Python.
get_current_loop
Get the current event loop from either Python or Rust async task local context
into_future
Convert a Python awaitable into a Rust Future
local_future_into_pyDeprecated
Convert a !Send Rust Future into a Python awaitable with a generic runtime
local_future_into_py_with_localsDeprecated
Convert a !Send Rust Future into a Python awaitable with a generic runtime and manual specification of task locals.
run
Run the event loop until the given Future completes
run_until_complete
Run the event loop until the given Future completes