()
| 24 | |
| 25 | impl PyObjVTable { |
| 26 | pub const fn of<T: PyObjectPayload>() -> &'static Self { |
| 27 | &Self { |
| 28 | typeid: T::PAYLOAD_TYPE_ID, |
| 29 | dealloc: default_dealloc::<T>, |
| 30 | debug: debug_obj::<T>, |
| 31 | trace: const { |
| 32 | if T::HAS_TRAVERSE { |
| 33 | Some(try_traverse_obj::<T>) |
| 34 | } else { |
| 35 | None |
| 36 | } |
| 37 | }, |
| 38 | clear: const { |
| 39 | if T::HAS_CLEAR { |
| 40 | Some(try_clear_obj::<T>) |
| 41 | } else { |
| 42 | None |
| 43 | } |
| 44 | }, |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | unsafe impl Traverse for InstanceDict { |