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
sourceimpl 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
This is supported on non-Py_LIMITED_API
only.
pub const fn fastcall_cfunction_with_keywords(
name: &'static str,
cfunction: PyCFunctionFastWithKeywords,
doc: &'static str
) -> Self
This is supported on 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) -> Result<PyMethodDef, NulByteInString>
pub(crate) fn as_method_def(&self) -> Result<PyMethodDef, NulByteInString>
Convert PyMethodDef
to Python method definition struct ffi::PyMethodDef
Trait Implementations
sourceimpl Clone for PyMethodDef
impl Clone for PyMethodDef
sourcefn clone(&self) -> PyMethodDef
fn clone(&self) -> PyMethodDef
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PyMethodDef
impl Debug for PyMethodDef
impl Sync for PyMethodDef
Auto Trait Implementations
impl RefUnwindSafe for PyMethodDef
impl Send for PyMethodDef
impl Unpin for PyMethodDef
impl UnwindSafe for PyMethodDef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more