pub struct GILGuard { /* private fields */ }
Expand description
RAII type that represents the Global Interpreter Lock acquisition.
Users are strongly encouraged to use Python::with_gil
instead of directly constructing this type.
See Python::acquire_gil
for more.
use pyo3::Python;
{
#[allow(deprecated)]
let gil_guard = Python::acquire_gil();
let py = gil_guard.python();
}
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
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.