#[doc(hidden)]#[repr(C)]pub struct PyVariableClassObject<T: PyClassImpl> {
ob_base: <T::BaseType as PyClassBaseType>::LayoutAsBase,
}Expand description
A layout for a PyClassObject with an unknown sized base type.
Utilises PEP-697
Fields§
§ob_base: <T::BaseType as PyClassBaseType>::LayoutAsBaseImplementations§
Source§impl<T: PyClass<Layout = Self>> PyVariableClassObject<T>
impl<T: PyClass<Layout = Self>> PyVariableClassObject<T>
Sourceunsafe fn get_contents_of_obj(
obj: *mut PyObject,
) -> *mut MaybeUninit<PyClassObjectContents<T>>
Available on Py_3_12 only.
unsafe fn get_contents_of_obj( obj: *mut PyObject, ) -> *mut MaybeUninit<PyClassObjectContents<T>>
Py_3_12 only.§Safety
objmust have the layout that the implementation is expecting- thread must be attached to the interpreter
fn get_contents_ptr(&self) -> *mut PyClassObjectContents<T>
Available on
Py_3_12 only.Trait Implementations§
Source§impl<T: PyClass<Layout = Self>> PyClassObjectBaseLayout<T> for PyVariableClassObject<T>
Available on Py_3_12 only.
impl<T: PyClass<Layout = Self>> PyClassObjectBaseLayout<T> for PyVariableClassObject<T>
Available on
Py_3_12 only.fn ensure_threadsafe(&self)
fn check_threadsafe(&self) -> Result<(), PyBorrowError>
Source§impl<T: PyClass<Layout = Self>> PyClassObjectLayout<T> for PyVariableClassObject<T>
Available on Py_3_12 only.
impl<T: PyClass<Layout = Self>> PyClassObjectLayout<T> for PyVariableClassObject<T>
Available on
Py_3_12 only.Source§const CONTENTS_OFFSET: PyObjectOffset
const CONTENTS_OFFSET: PyObjectOffset
Gets the offset of the contents from the start of the struct in bytes.
Source§const BASIC_SIZE: Py_ssize_t
const BASIC_SIZE: Py_ssize_t
Used to set
PyType_Spec::basicsize
(docs)Source§const DICT_OFFSET: PyObjectOffset
const DICT_OFFSET: PyObjectOffset
Gets the offset of the dictionary from the start of the struct in bytes.
Source§const WEAKLIST_OFFSET: PyObjectOffset
const WEAKLIST_OFFSET: PyObjectOffset
Gets the offset of the weakref list from the start of the struct in bytes.
Source§unsafe fn contents_uninit(
obj: *mut PyObject,
) -> *mut MaybeUninit<PyClassObjectContents<T>>
unsafe fn contents_uninit( obj: *mut PyObject, ) -> *mut MaybeUninit<PyClassObjectContents<T>>
Obtain a pointer to the contents of an uninitialized PyObject of this type. Read more
Source§fn ob_base(&self) -> &<T::BaseType as PyClassBaseType>::LayoutAsBase
fn ob_base(&self) -> &<T::BaseType as PyClassBaseType>::LayoutAsBase
obtain a reference to the data at the start of the PyObject.
Source§fn contents(&self) -> &PyClassObjectContents<T>
fn contents(&self) -> &PyClassObjectContents<T>
Obtain a reference to the structure that contains the pyclass struct and associated metadata.
Source§fn contents_mut(&mut self) -> &mut PyClassObjectContents<T>
fn contents_mut(&mut self) -> &mut PyClassObjectContents<T>
Obtain a mutable reference to the structure that contains the pyclass struct and associated metadata.