Struct pyo3::impl_::pymethods::PyMethodDef
source · pub struct PyMethodDef {
pub(crate) ml_name: &'static str,
pub(crate) ml_meth: PyMethodType,
pub(crate) ml_flags: c_int,
pub(crate) ml_doc: &'static str,
}
Fields§
§ml_name: &'static str
§ml_meth: PyMethodType
§ml_flags: c_int
§ml_doc: &'static str
Implementations§
source§impl PyMethodDef
impl PyMethodDef
sourcepub const fn noargs(
name: &'static str,
cfunction: PyCFunction,
doc: &'static str
) -> Self
pub const fn noargs( name: &'static str, cfunction: PyCFunction, doc: &'static str ) -> Self
Define a function with no *args
and **kwargs
.
sourcepub const fn cfunction_with_keywords(
name: &'static str,
cfunction: PyCFunctionWithKeywords,
doc: &'static str
) -> Self
pub const fn cfunction_with_keywords( name: &'static str, cfunction: PyCFunctionWithKeywords, doc: &'static str ) -> Self
Define a function that can take *args
and **kwargs
.
sourcepub const fn fastcall_cfunction_with_keywords(
name: &'static str,
cfunction: PyCFunctionFastWithKeywords,
doc: &'static str
) -> Self
Available on non-Py_LIMITED_API
only.
pub const fn fastcall_cfunction_with_keywords( name: &'static str, cfunction: PyCFunctionFastWithKeywords, doc: &'static str ) -> Self
Py_LIMITED_API
only.Define a function that can take *args
and **kwargs
.
pub const fn flags(self, flags: c_int) -> Self
sourcepub(crate) fn as_method_def(
&self
) -> PyResult<(PyMethodDef, PyMethodDefDestructor)>
pub(crate) fn as_method_def( &self ) -> PyResult<(PyMethodDef, PyMethodDefDestructor)>
Convert PyMethodDef
to Python method definition struct ffi::PyMethodDef
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 moresource§impl Debug for PyMethodDef
impl Debug for PyMethodDef
source§impl PyAddToModule for PyMethodDef
impl PyAddToModule for PyMethodDef
For adding a function to a module.
impl Sync for PyMethodDef
Auto Trait Implementations§
impl Freeze for PyMethodDef
impl RefUnwindSafe for PyMethodDef
impl Send for PyMethodDef
impl Unpin for PyMethodDef
impl UnwindSafe for PyMethodDef
Blanket Implementations§
source§impl<T> AssertNotZeroSized for T
impl<T> AssertNotZeroSized for T
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more