pub struct GILPool { /* private fields */ }
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.
Implementations§
source§impl 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 Freeze for GILPool
impl RefUnwindSafe for GILPool
impl !Send for GILPool
impl !Sync for GILPool
impl Unpin for GILPool
impl UnwindSafe for GILPool
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more