⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here
pub struct GILPool {
    start: Option<usize>,
    _not_send: NotSend,
}
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

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.

Gets the Python token associated with this GILPool.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. 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.