(
&self,
name: &'static str,
f: F,
flags: PyMethodFlags,
doc: Option<&'static str>,
)
| 644 | } |
| 645 | |
| 646 | pub fn new_method_def<F, FKind>( |
| 647 | &self, |
| 648 | name: &'static str, |
| 649 | f: F, |
| 650 | flags: PyMethodFlags, |
| 651 | doc: Option<&'static str>, |
| 652 | ) -> PyRef<HeapMethodDef> |
| 653 | where |
| 654 | F: IntoPyNativeFn<FKind>, |
| 655 | { |
| 656 | let def = PyMethodDef { |
| 657 | name, |
| 658 | func: Box::leak(Box::new(f.into_func())), |
| 659 | flags, |
| 660 | doc, |
| 661 | }; |
| 662 | let payload = HeapMethodDef::new(def); |
| 663 | PyRef::new_ref(payload, self.types.method_def.to_owned(), None) |
| 664 | } |
| 665 | |
| 666 | #[inline] |
| 667 | pub fn new_member( |
no test coverage detected