Trait rustpython_vm::types::Constructor
source · pub trait Constructor: PyPayload {
type Args: FromArgs;
// Required method
fn py_new(cls: PyTypeRef, args: Self::Args, vm: &VirtualMachine) -> PyResult;
// Provided methods
fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult { ... }
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>) { ... }
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>) { ... }
fn __extend_slots(slots: &mut PyTypeSlots) { ... }
}