Struct rustpython_vm::function::PyMethodDef
source · pub struct PyMethodDef {
pub name: &'static str,
pub func: &'static PyNativeFn,
pub flags: PyMethodFlags,
pub doc: Option<&'static str>,
}
Fields§
§name: &'static str
§func: &'static PyNativeFn
§flags: PyMethodFlags
§doc: Option<&'static str>
Implementations§
source§impl PyMethodDef
impl PyMethodDef
pub fn new<Kind>( name: &'static str, func: impl IntoPyNativeFn<Kind>, flags: PyMethodFlags, doc: Option<&'static str> ) -> Self
pub fn to_proper_method( &'static self, class: &'static Py<PyType>, ctx: &Context ) -> PyObjectRef
pub fn to_function(&'static self) -> PyNativeFunction
pub fn to_method( &'static self, class: &'static Py<PyType>, ctx: &Context ) -> PyMethodDescriptor
pub fn to_bound_method( &'static self, obj: PyObjectRef, class: &'static Py<PyType> ) -> PyNativeMethod
pub fn build_function(&'static self, ctx: &Context) -> PyRef<PyNativeFunction>
pub fn build_bound_function( &'static self, ctx: &Context, obj: PyObjectRef ) -> PyRef<PyNativeFunction>
pub fn build_method( &'static self, ctx: &Context, class: &'static Py<PyType> ) -> PyRef<PyMethodDescriptor>
pub fn build_bound_method( &'static self, ctx: &Context, obj: PyObjectRef, class: &'static Py<PyType> ) -> PyRef<PyNativeMethod>
pub fn build_classmethod( &'static self, ctx: &Context, class: &'static Py<PyType> ) -> PyRef<PyMethodDescriptor>
pub fn build_staticmethod( &'static self, ctx: &Context, class: &'static Py<PyType> ) -> PyRef<PyNativeMethod>
Trait Implementations§
source§impl Clone for PyMethodDef
impl Clone for PyMethodDef
source§fn clone(&self) -> PyMethodDef
fn clone(&self) -> PyMethodDef
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PyMethodDef
impl !Send for PyMethodDef
impl !Sync for PyMethodDef
impl Unpin for PyMethodDef
impl !UnwindSafe for PyMethodDef
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