Struct rustpython_vm::types::PyTypeSlots
source · #[non_exhaustive]pub struct PyTypeSlots {Show 22 fields
pub basicsize: usize,
pub as_number: PyNumberSlots,
pub as_sequence: AtomicCell<Option<PointerSlot<PySequenceMethods>>>,
pub as_mapping: AtomicCell<Option<PointerSlot<PyMappingMethods>>>,
pub hash: AtomicCell<Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<PyHash>>>,
pub call: AtomicCell<Option<fn(_: &PyObject, _: FuncArgs, _: &VirtualMachine) -> PyResult>>,
pub repr: AtomicCell<Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<PyStrRef>>>,
pub getattro: AtomicCell<Option<fn(_: &PyObject, _: &Py<PyStr>, _: &VirtualMachine) -> PyResult>>,
pub setattro: AtomicCell<Option<fn(_: &PyObject, _: &Py<PyStr>, _: PySetterValue, _: &VirtualMachine) -> PyResult<()>>>,
pub as_buffer: Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<PyBuffer>>,
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: PyTypeFlags,
pub doc: Option<&'static str>,
pub descr_get: AtomicCell<Option<fn(_: PyObjectRef, _: Option<PyObjectRef>, _: Option<PyObjectRef>, _: &VirtualMachine) -> PyResult>>,
pub descr_set: AtomicCell<Option<fn(_: &PyObject, _: PyObjectRef, _: PySetterValue, _: &VirtualMachine) -> PyResult<()>>>,
pub init: AtomicCell<Option<fn(_: PyObjectRef, _: FuncArgs, _: &VirtualMachine) -> PyResult<()>>>,
pub new: AtomicCell<Option<fn(_: PyTypeRef, _: FuncArgs, _: &VirtualMachine) -> PyResult>>,
pub del: AtomicCell<Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<()>>>,
pub member_count: usize,
/* private fields */
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.basicsize: usize
§as_number: PyNumberSlots
§as_sequence: AtomicCell<Option<PointerSlot<PySequenceMethods>>>
§as_mapping: AtomicCell<Option<PointerSlot<PyMappingMethods>>>
§hash: AtomicCell<Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<PyHash>>>
§call: AtomicCell<Option<fn(_: &PyObject, _: FuncArgs, _: &VirtualMachine) -> PyResult>>
§repr: AtomicCell<Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<PyStrRef>>>
§getattro: AtomicCell<Option<fn(_: &PyObject, _: &Py<PyStr>, _: &VirtualMachine) -> PyResult>>
§setattro: AtomicCell<Option<fn(_: &PyObject, _: &Py<PyStr>, _: PySetterValue, _: &VirtualMachine) -> PyResult<()>>>
§as_buffer: Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<PyBuffer>>
§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: PyTypeFlags
§doc: Option<&'static str>
§descr_get: AtomicCell<Option<fn(_: PyObjectRef, _: Option<PyObjectRef>, _: Option<PyObjectRef>, _: &VirtualMachine) -> PyResult>>
§descr_set: AtomicCell<Option<fn(_: &PyObject, _: PyObjectRef, _: PySetterValue, _: &VirtualMachine) -> PyResult<()>>>
§init: AtomicCell<Option<fn(_: PyObjectRef, _: FuncArgs, _: &VirtualMachine) -> PyResult<()>>>
§new: AtomicCell<Option<fn(_: PyTypeRef, _: FuncArgs, _: &VirtualMachine) -> PyResult>>
§del: AtomicCell<Option<fn(_: &PyObject, _: &VirtualMachine) -> PyResult<()>>>
§member_count: usize
Implementations§
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
source§impl Default for PyTypeSlots
impl Default for PyTypeSlots
source§fn default() -> PyTypeSlots
fn default() -> PyTypeSlots
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PyTypeSlots
impl !Send for PyTypeSlots
impl !Sync for PyTypeSlots
impl Unpin for PyTypeSlots
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more