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

Method try_downcast

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

Source from the content-addressed store, hash-verified

1273 }
1274
1275 pub fn try_downcast<T: PyPayload>(self, vm: &VirtualMachine) -> PyResult<PyRef<T>> {
1276 T::try_downcast_from(&self, vm)?;
1277 Ok(unsafe { self.downcast_unchecked() })
1278 }
1279
1280 /// Force to downcast this reference to a subclass.
1281 ///

Callers 1

from_pycMethod · 0.80

Calls 1

downcast_uncheckedMethod · 0.80

Tested by

no test coverage detected