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

Function calcsize

crates/stdlib/src/pystruct.rs:229–231  ·  view source on GitHub ↗
(fmt: IntoStructFormatBytes, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

227
228 #[pyfunction]
229 fn calcsize(fmt: IntoStructFormatBytes, vm: &VirtualMachine) -> PyResult<usize> {
230 Ok(fmt.format_spec(vm)?.size)
231 }
232
233 #[pyattr]
234 #[pyclass(name = "Struct", traverse)]

Callers 7

test_alignmentMethod · 0.90
test_simple_structsMethod · 0.90
test_simple_unionsMethod · 0.90
_check_sizeFunction · 0.90
_check_sizeFunction · 0.90
test_objecttypesMethod · 0.85
test_sizeof_exactMethod · 0.85

Calls 1

format_specMethod · 0.45

Tested by 5

test_alignmentMethod · 0.72
test_simple_structsMethod · 0.72
test_simple_unionsMethod · 0.72
test_objecttypesMethod · 0.68
test_sizeof_exactMethod · 0.68