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

Method payload_if_exact

crates/vm/src/object/core.rs:1444–1451  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1442 #[deprecated(note = "use downcast_ref_if_exact instead")]
1443 #[inline(always)]
1444 pub fn payload_if_exact<T: PyPayload>(&self, vm: &VirtualMachine) -> Option<&T> {
1445 if self.class().is(T::class(&vm.ctx)) {
1446 #[allow(deprecated)]
1447 self.payload()
1448 } else {
1449 None
1450 }
1451 }
1452
1453 #[inline(always)]
1454 fn instance_dict(&self) -> Option<&InstanceDict> {

Callers

nothing calls this directly

Calls 3

isMethod · 0.80
payloadMethod · 0.80
classMethod · 0.45

Tested by

no test coverage detected