pub struct PyMethodDef {
pub(crate) ml_name: &'static CStr,
pub(crate) ml_meth: PyMethodType,
pub(crate) ml_flags: c_int,
pub(crate) ml_doc: &'static CStr,
}
Fields§
§ml_name: &'static CStr
§ml_meth: PyMethodType
§ml_flags: c_int
§ml_doc: &'static CStr
Implementations§
Source§impl PyMethodDef
impl PyMethodDef
Sourcepub const fn noargs(
ml_name: &'static CStr,
cfunction: PyCFunction,
ml_doc: &'static CStr,
) -> Self
pub const fn noargs( ml_name: &'static CStr, cfunction: PyCFunction, ml_doc: &'static CStr, ) -> Self
Define a function with no *args
and **kwargs
.
Sourcepub const fn cfunction_with_keywords(
ml_name: &'static CStr,
cfunction: PyCFunctionWithKeywords,
ml_doc: &'static CStr,
) -> Self
pub const fn cfunction_with_keywords( ml_name: &'static CStr, cfunction: PyCFunctionWithKeywords, ml_doc: &'static CStr, ) -> Self
Define a function that can take *args
and **kwargs
.
Sourcepub const fn fastcall_cfunction_with_keywords(
ml_name: &'static CStr,
cfunction: PyCFunctionFastWithKeywords,
ml_doc: &'static CStr,
) -> Self
Available on Py_3_10
or non-Py_LIMITED_API
only.
pub const fn fastcall_cfunction_with_keywords( ml_name: &'static CStr, cfunction: PyCFunctionFastWithKeywords, ml_doc: &'static CStr, ) -> Self
Py_3_10
or non-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) -> PyMethodDef
pub(crate) fn as_method_def(&self) -> PyMethodDef
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 Sealed for PyMethodDef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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