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

Method try_from_borrowed_object

crates/stdlib/src/zlib.rs:496–499  ·  view source on GitHub ↗
(vm: &VirtualMachine, obj: &'a PyObject)

Source from the content-addressed store, hash-verified

494
495 impl<'a> TryFromBorrowedObject<'a> for Level {
496 fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
497 let int: i32 = obj.try_index(vm)?.try_to_primitive(vm)?;
498 Ok(Self::new(int))
499 }
500 }
501
502 #[pyattr]

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
try_to_primitiveMethod · 0.80
try_indexMethod · 0.80

Tested by

no test coverage detected