#[non_exhaustive]pub struct PyTypeSlots {Show 29 fields
pub basicsize: usize,
pub itemsize: usize,
pub as_number: PyNumberSlots,
pub as_sequence: PySequenceSlots,
pub as_mapping: PyMappingSlots,
pub hash: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyHash>>>,
pub call: AtomicCell<Option<fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult>>,
pub vectorcall: AtomicCell<Option<fn(&PyObject, Vec<PyObjectRef>, usize, Option<&[PyObjectRef]>, &VirtualMachine) -> PyResult>>,
pub str: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>>>,
pub repr: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>>>,
pub getattro: AtomicCell<Option<fn(&PyObject, &Py<PyStr>, &VirtualMachine) -> PyResult>>,
pub setattro: AtomicCell<Option<fn(&PyObject, &Py<PyStr>, PySetterValue, &VirtualMachine) -> PyResult<()>>>,
pub as_buffer: AtomicCell<Option<fn(&PyObject, BufferFlags, &VirtualMachine) -> PyResult<PyBuffer>>>,
pub has_release_buffer: AtomicCell<bool>,
pub python_release_buffer: AtomicCell<bool>,
pub richcompare: AtomicCell<Option<fn(&PyObject, &PyObject, PyComparisonOp, &VirtualMachine) -> PyResult<Either<PyObjectRef, PyComparisonValue>>>>,
pub iter: AtomicCell<Option<fn(PyObjectRef, &VirtualMachine) -> PyResult>>,
pub iternext: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyIterReturn>>>,
pub methods: &'static [PyMethodDef],
pub flags: AtomicPyTypeFlags,
pub doc: ItemDoc,
pub descr_get: AtomicCell<Option<fn(&PyObject, Option<&PyObject>, Option<&PyObject>, &VirtualMachine) -> PyResult>>,
pub descr_set: AtomicCell<Option<fn(&PyObject, PyObjectRef, PySetterValue, &VirtualMachine) -> PyResult<()>>>,
pub init: AtomicCell<Option<fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult<()>>>,
pub alloc: AtomicCell<Option<fn(PyTypeRef, usize, &VirtualMachine) -> PyResult>>,
pub new: AtomicCell<Option<fn(PyTypeRef, FuncArgs, &VirtualMachine) -> PyResult>>,
pub del: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<()>>>,
pub del_needed: AtomicCell<Option<DelNeededFunc>>,
pub member_count: usize,
/* private fields */
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.basicsize: usizeFull tp_basicsize: object header plus payload. 0 before type
creation means “inherit the base size”.
itemsize: usize§as_number: PyNumberSlots§as_sequence: PySequenceSlots§as_mapping: PyMappingSlots§hash: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyHash>>>§call: AtomicCell<Option<fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult>>§vectorcall: AtomicCell<Option<fn(&PyObject, Vec<PyObjectRef>, usize, Option<&[PyObjectRef]>, &VirtualMachine) -> PyResult>>§str: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>>>§repr: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>>>§getattro: AtomicCell<Option<fn(&PyObject, &Py<PyStr>, &VirtualMachine) -> PyResult>>§setattro: AtomicCell<Option<fn(&PyObject, &Py<PyStr>, PySetterValue, &VirtualMachine) -> PyResult<()>>>§as_buffer: AtomicCell<Option<fn(&PyObject, BufferFlags, &VirtualMachine) -> PyResult<PyBuffer>>>§has_release_buffer: AtomicCell<bool>bf_releasebuffer: releasing an export of this type is observable, so the
type exposes __release_buffer__.
python_release_buffer: AtomicCell<bool>True when a Python-level __release_buffer__ must be invoked on release.
richcompare: AtomicCell<Option<fn(&PyObject, &PyObject, PyComparisonOp, &VirtualMachine) -> PyResult<Either<PyObjectRef, PyComparisonValue>>>>§iter: AtomicCell<Option<fn(PyObjectRef, &VirtualMachine) -> PyResult>>§iternext: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<PyIterReturn>>>§methods: &'static [PyMethodDef]§flags: AtomicPyTypeFlags§doc: ItemDoc§descr_get: AtomicCell<Option<fn(&PyObject, Option<&PyObject>, Option<&PyObject>, &VirtualMachine) -> PyResult>>§descr_set: AtomicCell<Option<fn(&PyObject, PyObjectRef, PySetterValue, &VirtualMachine) -> PyResult<()>>>§init: AtomicCell<Option<fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult<()>>>§alloc: AtomicCell<Option<fn(PyTypeRef, usize, &VirtualMachine) -> PyResult>>§new: AtomicCell<Option<fn(PyTypeRef, FuncArgs, &VirtualMachine) -> PyResult>>§del: AtomicCell<Option<fn(&PyObject, &VirtualMachine) -> PyResult<()>>>§del_needed: AtomicCell<Option<DelNeededFunc>>Optional fast, VM-free predicate checked before del is invoked via
drop_slow_inner/try_call_finalizer. Those call sites otherwise pay
for attaching to a VM (with_vm) unconditionally whenever a type has
a del slot at all, even when the type’s own del is a documented
no-op for the object’s current state (e.g. an already-exhausted
generator or coroutine). Returning false skips the del call
entirely, avoiding that VM lookup; None (the default) preserves the
prior behavior of always calling del.
member_count: usizeImplementations§
Source§impl PyTypeSlots
impl PyTypeSlots
pub fn new(name: &'static str, flags: PyTypeFlags) -> Self
pub fn heap_default() -> Self
Trait Implementations§
Source§impl Debug for PyTypeSlots
impl Debug for PyTypeSlots
Auto Trait Implementations§
impl !Freeze for PyTypeSlots
impl !RefUnwindSafe for PyTypeSlots
impl !Send for PyTypeSlots
impl !Sync for PyTypeSlots
impl !UnwindSafe for PyTypeSlots
impl Unpin for PyTypeSlots
impl UnsafeUnpin for PyTypeSlots
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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> ⓘ
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> ⓘ
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