Trait AsNumber

Source
pub trait AsNumber: PyPayload {
    const __OWN_METHOD_DEFS: &'static [PyMethodDef] = _;

    // 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_py_class(ctx: &Context, class: &'static Py<PyType>) { ... }
    fn __extend_slots(slots: &mut PyTypeSlots) { ... }
}

Provided Associated Constants§

Source

const __OWN_METHOD_DEFS: &'static [PyMethodDef] = _

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_py_class(ctx: &Context, class: &'static Py<PyType>)

Source

fn __extend_slots(slots: &mut PyTypeSlots)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Morty Proxy This is a proxified and sanitized view of the page, visit original site.