Skip to main content

Module context

Module context 

Source
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.

Macros§

watch_callback
Creates a context watcher callback from a safe Rust function.

Structs§

BoundContextWatcherGuard
A Python-bound guard which keeps a context watcher registered.
ContextWatcherGuard
An unbound guard which keeps a context watcher registered.
PyContext
Represents a Python contextvars.Context object.
WatchCallback
Callback type for context watchers.

Enums§

ContextEvent
An event passed to a context watcher.