Skip to main content

MethodDef

Trait MethodDef 

Source
pub trait MethodDef<T> {
    const METH: T;
}
Expand description

A workaround for Rust not allowing function pointers as const generics: define a trait which has a constant function pointer.

Required Associated Constants§

Source

const METH: T

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§

Source§

impl MethodDef<for<'py> unsafe fn(Python<'py>, *mut PyObject) -> Result<*mut PyObject, PyErr>> for Def

Available on crate feature experimental-async only.
Source§

const METH: Func = Coroutine::__pymethod___await____

Source§

impl MethodDef<for<'py> unsafe fn(Python<'py>, *mut PyObject) -> Result<*mut PyObject, PyErr>> for Def

Available on crate feature experimental-async only.
Source§

const METH: Func = Coroutine::__pymethod___next____

Source§

impl MethodDef<for<'py> unsafe fn(Python<'py>, *mut PyObject, *const *mut PyObject, isize, *mut PyObject) -> Result<*mut PyObject, PyErr>> for Def

Available on crate feature experimental-async only.
Source§

const METH: Func = __pyfunction_release_waiter

Source§

impl MethodDef<for<'py> unsafe fn(Python<'py>, *mut PyObject, *const *mut PyObject, isize, *mut PyObject) -> Result<*mut PyObject, PyErr>> for Def

Available on crate feature experimental-async only.
Source§

const METH: Func = Coroutine::__pymethod_send__

Source§

impl MethodDef<for<'py> unsafe fn(Python<'py>, *mut PyObject, *const *mut PyObject, isize, *mut PyObject) -> Result<*mut PyObject, PyErr>> for Def

Available on crate feature experimental-async only.
Source§

const METH: Func = Coroutine::__pymethod_throw__

Source§

impl MethodDef<unsafe fn(Python<'_>, *mut PyObject) -> Result<*mut PyObject, PyErr>> for Def

Available on crate feature experimental-async only.
Source§

const METH: Func = Coroutine::__pymethod_close__

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here