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 theunstable-streams
Cargo feature is enabled:
[dependencies.pyo3-asyncio]
version = "0.20"
features = ["unstable-streams"]
Traits§
- Context
Ext - Exposes the utilities necessary for using task-local data in the Runtime
- Join
Error - Generic utilities for a JoinError
- Local
Context Ext - Adds the ability to scope task-local data for !Send futures
- Runtime
- Generic Rust async/await runtime
- Spawn
Local Ext - 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_ py Deprecated - Convert a
!Send
Rust Future into a Python awaitable with a generic runtime - local_
future_ into_ py_ with_ locals Deprecated - 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