Expand description
A RAII pool which PyO3 uses to store owned Python references.
See the Memory Management chapter of the guide for more information about how PyO3 uses
GILPool
to manage memory.
Fields
start: Option<usize>
Initial length of owned objects and anys.
Option
is used since TSL can be broken when new
is called from atexit
.
_not_send: NotSend
Implementations
sourceimpl GILPool
impl GILPool
sourcepub unsafe fn new() -> GILPool
pub unsafe fn new() -> GILPool
Creates a new GILPool
. This function should only ever be called with the GIL held.
It is recommended not to use this API directly, but instead to use Python::new_pool
, as
that guarantees the GIL is held.
Safety
As well as requiring the GIL, see the safety notes on Python::new_pool
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GILPool
impl !Send for GILPool
impl !Sync for GILPool
impl Unpin for GILPool
impl UnwindSafe for GILPool
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more