Struct pyo3::impl_::pyclass::lazy_type_object::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