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ยง

use crate::PyAny; ๐Ÿ”’
use crate::ffi; ๐Ÿ”’
use crate::Borrowed; ๐Ÿ”’ Py_3_14 and non-Py_GIL_DISABLED
use crate::PyResult; ๐Ÿ”’ Py_3_14 and non-Py_GIL_DISABLED
use crate::Python; ๐Ÿ”’ Py_3_14 and non-Py_GIL_DISABLED
use crate::err; ๐Ÿ”’ Py_3_14 and non-Py_GIL_DISABLED
use core::ffi::c_int; ๐Ÿ”’ Py_3_14 and non-Py_GIL_DISABLED
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