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 CStrImplementations§
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 that takes no arguments.
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 takes arbitrary arguments as a tuple and dict.
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 takes arbitrary arguments as a C-style array and tuple of keyword arguments.
Sourcepub const fn maybe_fastcall_cfunction_with_keywords(
ml_name: &'static CStr,
cfunction: PyCFunctionFastWithKeywords,
ml_doc: &'static CStr,
) -> Self
pub const fn maybe_fastcall_cfunction_with_keywords( ml_name: &'static CStr, cfunction: PyCFunctionFastWithKeywords, ml_doc: &'static CStr, ) -> Self
Abstraction over fastcall to fall back to varargs on older Python versions.
pub const fn flags(self, flags: c_int) -> Self
pub const fn into_raw(self) -> PyMethodDef
Trait Implementations§
Source§impl Clone for PyMethodDef
impl Clone for PyMethodDef
Source§fn clone(&self) -> PyMethodDef
fn clone(&self) -> PyMethodDef
Returns a duplicate 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
impl Copy for PyMethodDef
impl Sealed for PyMethodDef
impl TrivialClone for PyMethodDef
Auto Trait Implementations§
impl Freeze for PyMethodDef
impl RefUnwindSafe for PyMethodDef
impl Send for PyMethodDef
impl Sync for PyMethodDef
impl Unpin for PyMethodDef
impl UnsafeUnpin 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
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 moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
🔬This is a nightly-only experimental API. (
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more