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

Method payload_unchecked

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

Source from the content-addressed store, hash-verified

1412 #[deprecated(note = "use downcast_unchecked_ref instead")]
1413 #[inline(always)]
1414 pub const unsafe fn payload_unchecked<T: PyPayload>(&self) -> &T {
1415 // we cast to a PyInner<T> first because we don't know T's exact offset because of
1416 // varying alignment, but once we get a PyInner<T> the compiler can get it for us
1417 let inner = unsafe { &*(&self.0 as *const PyInner<Erased> as *const PyInner<T>) };
1418 &inner.payload
1419 }
1420
1421 #[deprecated(note = "use downcast_ref instead")]
1422 #[inline(always)]

Callers 1

payloadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected