Struct LazyTypeObject

Source
#[doc(hidden)] pub struct LazyTypeObject<T>(LazyTypeObjectInner, PhantomData<T>);
Expand description

Lazy type object for PyClass.

Tuple Fields§

§0: LazyTypeObjectInner§1: PhantomData<T>

Implementations§

Source§

impl<T> LazyTypeObject<T>

Source

pub const fn new() -> Self

Creates an uninitialized LazyTypeObject.

Source§

impl<T: PyClass> LazyTypeObject<T>

Source

pub fn get_or_init<'py>(&self, py: Python<'py>) -> &Bound<'py, PyType>

Gets the type object contained by this LazyTypeObject, initializing it if needed.

Source

pub(crate) fn get_or_try_init<'py>( &self, py: Python<'py>, ) -> PyResult<&Bound<'py, PyType>>

Fallible version of the above.

Trait Implementations§

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here