Skip to main content

Module context

Module context 

Source
Available on neither GraalPy nor Py_LIMITED_API nor PyPy nor RustPython.
Expand description

Types and APIs for Python contextvars.Context objects.

On GIL-enabled Python 3.14 and newer, this module also provides safe bindings for watching changes to the current context.

Re-exports§

pub use crate::watch_callback;Py_3_14 and non-Py_GIL_DISABLED

Modules§

impl_ 👻 Py_3_14 and non-Py_GIL_DISABLED
Implementation details used by watch_callback!.

Structs§

BoundContextWatcherGuardPy_3_14 and non-Py_GIL_DISABLED
A Python-bound guard which keeps a context watcher registered.
ContextWatcherGuardPy_3_14 and non-Py_GIL_DISABLED
An unbound guard which keeps a context watcher registered.
PyContext
Represents a Python contextvars.Context object.
WatchCallbackPy_3_14 and non-Py_GIL_DISABLED
Callback type for context watchers.

Enums§

ContextEventPy_3_14 and non-Py_GIL_DISABLED
An event passed to a context watcher.

Functions§

clear_watcher 🔒 Py_3_14 and non-Py_GIL_DISABLED
clear_watcher_on_drop 🔒 Py_3_14 and non-Py_GIL_DISABLED
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here