MCPcopy Index your code
hub / github.com/RustPython/RustPython / to_base

Method to_base

crates/vm/src/object/core.rs:2260–2265  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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]

Callers 7

execute_instrumentedMethod · 0.45
instrument_codeFunction · 0.45
setattroMethod · 0.45
setattroMethod · 0.45
mark_stacksFunction · 0.45
co_branchesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected