pub trait AsNumber: PyPayload {
    // Required method
    fn as_number() -> &'static PyNumberMethods;

    // Provided methods
    fn clone_exact(_zelf: &Py<Self>, _vm: &VirtualMachine) -> PyRef<Self> { ... }
    fn number_downcast(num: PyNumber<'_>) -> &Py<Self> { ... }
    fn number_downcast_exact(
        num: PyNumber<'_>,
        vm: &VirtualMachine
    ) -> PyRef<Self> { ... }
    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) { ... }
}

Required Methods§

Provided Methods§

source

fn clone_exact(_zelf: &Py<Self>, _vm: &VirtualMachine) -> PyRef<Self>

source

fn number_downcast(num: PyNumber<'_>) -> &Py<Self>

source

fn number_downcast_exact(num: PyNumber<'_>, vm: &VirtualMachine) -> PyRef<Self>

source

fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)

source

fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)

source

fn __extend_slots(slots: &mut PyTypeSlots)

Implementors§