#[must_use]
pub struct GILGuard { /* fields omitted */ }
RAII type that represents the Global Interpreter Lock acquisition.
use pyo3::Python;
{
let gil_guard = Python::acquire_gil();
let py = gil_guard.python();
}
Acquires the global interpreter lock, which allows access to the Python runtime.
If the Python runtime is not already initialized, this function will initialize it.
See prepare_freethreaded_python() for details.
Retrieves the marker type that proves that the GIL was acquired.
The Drop implementation for GILGuard
will release the GIL.
Executes the destructor for this type. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static