(&self)
| 2258 | /// Converts `&Py<T>` to `&Py<T::Base>`. |
| 2259 | #[inline] |
| 2260 | pub fn to_base(&self) -> &Py<T::Base> { |
| 2261 | debug_assert!(self.as_object().downcast_ref::<T::Base>().is_some()); |
| 2262 | // SAFETY: T is #[repr(transparent)] over T::Base, |
| 2263 | // so Py<T> and Py<T::Base> have the same layout. |
| 2264 | unsafe { &*(self as *const Py<T> as *const Py<T::Base>) } |
| 2265 | } |
| 2266 | |
| 2267 | /// Converts `&Py<T>` to `&Py<U>` where U is an ancestor type. |
| 2268 | #[inline] |
no outgoing calls
no test coverage detected