Debian Codegraph @

src/methodobject.rs

raw symbols SCIP
1 use craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::objectrust-analyzer cargo pyo3-ffi 0.28.2 object/::{PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#, PyTypeObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyTypeObject#, Py_TYPErust-analyzer cargo pyo3-ffi 0.28.2 object/Py_TYPE().};
2 #[cfg(Py_3_9)]
3 use craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::PyObject_TypeCheckrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject_TypeCheck().;
4 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::{c_charrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_char#, c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int#, c_voidrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_void#};
5 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/, ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/};
6
7 #[cfg(all(Py_3_9, not(Py_LIMITED_API), not(GraalPy)))]
8 pub struct PyCFunctionObject {
9 pub ob_base: PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
10 pub m_ml: *mut PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#,
11 pub m_self: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
12 pub m_module: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
13 pub m_weakreflist: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
14 #[cfg(not(PyPy))]
15 pub vectorcall: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::vectorcallfunc>,
16 }
17
18 #[cfg_attr(windows, link(name = "pythonXY"))]
19 extern "C" {
20 #[cfg_attr(PyPy, link_name = "PyPyCFunction_Type")]
21 pub static mut PyCFunction_Typerust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_Type.: PyTypeObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyTypeObject#;
22 }
23
24 #[cfg(Py_3_9)]
25 #[inline]
26 pub unsafe fn PyCFunction_CheckExact(op: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# {
27 (Py_TYPErust-analyzer cargo pyo3-ffi 0.28.2 object/Py_TYPE().(op) == ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::addr_of_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/addr_of_mut!!(PyCFunction_Type)) as c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int#
28 }
29
30 #[cfg(Py_3_9)]
31 #[inline]
32 pub unsafe fn PyCFunction_Check(op: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# {
33 PyObject_TypeCheck(op, ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::addr_of_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/addr_of_mut!!(PyCFunction_Type))
34 }
35
36 #[cfg(not(Py_3_9))]
37 #[inline]
38 pub unsafe fn PyCFunction_Checkrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyCFunction_Check().(op: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# {
39 (Py_TYPErust-analyzer cargo pyo3-ffi 0.28.2 object/Py_TYPE().(op) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`][`PartialEq<Self>`]eq().ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::addr_of_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/addr_of_mut!!(PyCFunction_Typerust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_Type.)) as c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int#
40 }
41
42 pub type PyCFunctionrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyCFunction# =
43 unsafe extern "C" fn(slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#, args: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
44
45 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
46 pub type PyCFunctionFast = unsafe extern "C" fn(
47 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
48 args: *mut *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
49 nargs: craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::pyportrust-analyzer cargo pyo3-ffi 0.28.2 pyport/::Py_ssize_trust-analyzer cargo pyo3-ffi 0.28.2 pyport/Py_ssize_t#,
50 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
51
52 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
53 #[deprecated(note = "renamed to `PyCFunctionFast`")]
54 pub type _PyCFunctionFast = PyCFunctionFast;
55
56 pub type PyCFunctionWithKeywordsrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyCFunctionWithKeywords# = unsafe extern "C" fn(
57 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
58 args: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
59 kwds: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
60 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
61
62 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
63 pub type PyCFunctionFastWithKeywords = unsafe extern "C" fn(
64 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
65 args: *const *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
66 nargs: craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::pyportrust-analyzer cargo pyo3-ffi 0.28.2 pyport/::Py_ssize_trust-analyzer cargo pyo3-ffi 0.28.2 pyport/Py_ssize_t#,
67 kwnames: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
68 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
69
70 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
71 #[deprecated(note = "renamed to `PyCFunctionFastWithKeywords`")]
72 pub type _PyCFunctionFastWithKeywords = PyCFunctionFastWithKeywords;
73
74 #[cfg(all(Py_3_9, not(Py_LIMITED_API)))]
75 pub type PyCMethod = unsafe extern "C" fn(
76 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
77 defining_class: *mut PyTypeObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyTypeObject#,
78 args: *const *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
79 nargs: craterust-analyzer cargo pyo3-ffi 0.28.2 crate/::pyportrust-analyzer cargo pyo3-ffi 0.28.2 pyport/::Py_ssize_trust-analyzer cargo pyo3-ffi 0.28.2 pyport/Py_ssize_t#,
80 kwnames: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
81 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
82
83 extern "C" {
84 #[cfg_attr(PyPy, link_name = "PyPyCFunction_GetFunction")]
85 pub fn PyCFunction_GetFunctionrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_GetFunction().(f: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<PyCFunctionrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyCFunction#>;
86 pub fn PyCFunction_GetSelfrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_GetSelf().(f: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
87 pub fn PyCFunction_GetFlagsrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_GetFlags().(f: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int#;
88 #[cfg(not(Py_3_13))]
89 #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
90 pub fn PyCFunction_Callrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_Call().(
91 f: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
92 args: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
93 kwds: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
94 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
95 }
96
97 /// Represents the [PyMethodDef](https://docs.python.org/3/c-api/structures.html#c.PyMethodDef)
98 /// structure.
99 ///
100 /// Note that CPython may leave fields uninitialized. You must ensure that
101 /// `ml_name` != NULL before dereferencing or reading other fields.
102 #[repr(C)]
103 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
104 pub struct PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
105 pub ml_namerust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_name.: *const c_charrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_char#,
106 pub ml_methrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_meth.: PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#,
107 pub ml_flagsrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_flags.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int#,
108 pub ml_docrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_doc.: *const c_charrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_char#,
109 }
110
111 impl PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
112 pub const fn zeroedrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDef]zeroed().() -> PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
113 PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
114 ml_namerust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_name.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null().(),
115 ml_methrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_meth.: PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
116 Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().(),
117 },
118 ml_flagsrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_flags.: 0,
119 ml_docrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_doc.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null().(),
120 }
121 }
122 }
123
124 impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
125 fn defaultrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDef][Default]default().() -> PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
126 PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef# {
127 ml_namerust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_name.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null().(),
128 ml_methrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_meth.: PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
129 Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().(),
130 },
131 ml_flagsrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_flags.: 0,
132 ml_docrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#ml_doc.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null().(),
133 }
134 }
135 }
136
137 /// Function types used to implement Python callables.
138 ///
139 /// This function pointer must be accompanied by the correct [ml_flags](PyMethodDef::ml_flags),
140 /// otherwise the behavior is undefined.
141 ///
142 /// See the [Python C API documentation][1] for more information.
143 ///
144 /// [1]: https://docs.python.org/3/c-api/structures.html#implementing-functions-and-methods
145 #[repr(C)]
146 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
147 pub union PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
148 /// This variant corresponds with [`METH_VARARGS`] *or* [`METH_NOARGS`] *or* [`METH_O`].
149 pub PyCFunctionrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#PyCFunction.: PyCFunctionrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyCFunction#,
150
151 /// This variant corresponds with [`METH_VARARGS`] | [`METH_KEYWORDS`].
152 pub PyCFunctionWithKeywordsrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#PyCFunctionWithKeywords.: PyCFunctionWithKeywordsrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyCFunctionWithKeywords#,
153
154 /// This variant corresponds with [`METH_FASTCALL`].
155 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
156 #[deprecated(note = "renamed to `PyCFunctionFast`")]
157 pub _PyCFunctionFast: PyCFunctionFast,
158
159 /// This variant corresponds with [`METH_FASTCALL`].
160 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
161 pub PyCFunctionFast: PyCFunctionFast,
162
163 /// This variant corresponds with [`METH_FASTCALL`] | [`METH_KEYWORDS`].
164 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
165 #[deprecated(note = "renamed to `PyCFunctionFastWithKeywords`")]
166 pub _PyCFunctionFastWithKeywords: PyCFunctionFastWithKeywords,
167
168 /// This variant corresponds with [`METH_FASTCALL`] | [`METH_KEYWORDS`].
169 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
170 pub PyCFunctionFastWithKeywords: PyCFunctionFastWithKeywords,
171
172 /// This variant corresponds with [`METH_METHOD`] | [`METH_FASTCALL`] | [`METH_KEYWORDS`].
173 #[cfg(all(Py_3_9, not(Py_LIMITED_API)))]
174 pub PyCMethod: PyCMethod,
175
176 Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void.: *mut c_voidrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_void#,
177 }
178
179 impl PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
180 pub fn as_ptrrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer]as_ptr().(&self) -> *mut c_voidrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_void# {
181 unsafe { self.Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void. }
182 }
183
184 pub fn is_nullrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer]is_null().(&self) -> bool {
185 self.as_ptrrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer]as_ptr().().is_nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`]is_null().()
186 }
187
188 pub const fn zeroedrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer]zeroed().() -> PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
189 PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
190 Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void.: ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().(),
191 }
192 }
193 }
194
195 impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
196 fn eqrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer][`PartialEq<Self>`]eq().(&self, other: &Selfrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer][`PartialEq<Self>`]) -> bool {
197 unsafe { self.Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`][`PartialEq<Self>`]eq().other.Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void. }
198 }
199 }
200
201 impl stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Pointerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Pointer# for PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer# {
202 fn fmtrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/impl#[PyMethodDefPointer][Pointer]fmt().(&self, f: &mut stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
203 let ptr = unsafe { self.Voidrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#Void. };
204 stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Pointerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Pointer#::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`*mut T`][Pointer]fmt().(&ptr, f)
205 }
206 }
207
208 const _: () =
209 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<PyMethodDefPointerrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDefPointer#>() == memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<extern "C" fn()>>());
210
211 #[cfg(not(Py_3_9))]
212 extern "C" {
213 #[cfg_attr(PyPy, link_name = "PyPyCFunction_New")]
214 pub fn PyCFunction_Newrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_New().(ml: *mut PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#, slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
215
216 #[cfg_attr(PyPy, link_name = "PyPyCFunction_NewEx")]
217 pub fn PyCFunction_NewExrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_NewEx().(
218 ml: *mut PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#,
219 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
220 module: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
221 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
222 }
223
224 #[cfg(Py_3_9)]
225 #[inline]
226 pub unsafe fn PyCFunction_New(ml: *mut PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#, slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject# {
227 PyCFunction_NewExrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_NewEx().(ml, slf, stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().())
228 }
229
230 #[cfg(Py_3_9)]
231 #[inline]
232 pub unsafe fn PyCFunction_NewEx(
233 ml: *mut PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#,
234 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
235 module: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
236 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject# {
237 PyCMethod_New(ml, slf, module, stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().())
238 }
239
240 #[cfg(Py_3_9)]
241 extern "C" {
242 #[cfg_attr(PyPy, link_name = "PyPyCMethod_New")]
243 pub fn PyCMethod_New(
244 ml: *mut PyMethodDefrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/PyMethodDef#,
245 slf: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
246 module: *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#,
247 cls: *mut PyTypeObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyTypeObject#,
248 ) -> *mut PyObjectrust-analyzer cargo pyo3-ffi 0.28.2 object/PyObject#;
249 }
250
251 /* Flag passed to newmethodobject */
252 pub const METH_VARARGSrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_VARARGS.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0001;
253 pub const METH_KEYWORDSrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_KEYWORDS.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0002;
254 /* METH_NOARGS and METH_O must not be combined with the flags above. */
255 pub const METH_NOARGSrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_NOARGS.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0004;
256 pub const METH_Orust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_O.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0008;
257
258 /* METH_CLASS and METH_STATIC are a little different; these control
259 the construction of methods for a class. These cannot be used for
260 functions in modules. */
261 pub const METH_CLASSrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_CLASS.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0010;
262 pub const METH_STATICrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_STATIC.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0020;
263
264 /* METH_COEXIST allows a method to be entered eventhough a slot has
265 already filled the entry. When defined, the flag allows a separate
266 method, "__contains__" for example, to coexist with a defined
267 slot like sq_contains. */
268
269 pub const METH_COEXISTrust-analyzer cargo pyo3-ffi 0.28.2 methodobject/METH_COEXIST.: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0040;
270
271 /* METH_FASTCALL indicates the PEP 590 Vectorcall calling format. It may
272 be specified alone or with METH_KEYWORDS. */
273 #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
274 pub const METH_FASTCALL: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0080;
275
276 // skipped METH_STACKLESS
277
278 #[cfg(all(Py_3_9, not(Py_LIMITED_API)))]
279 pub const METH_METHOD: c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int# = 0x0200;
280
281 extern "C" {
282 #[cfg(not(Py_3_9))]
283 pub fn PyCFunction_ClearFreeListrust-analyzer cargo pyo3-ffi 0.28.2 PyCFunction_ClearFreeList().() -> c_intrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/primitives/c_int#;
284 }