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

Function new_struct_error

crates/vm/src/buffer.rs:725–730  ·  view source on GitHub ↗
(vm: &VirtualMachine, msg: impl Into<String>)

Source from the content-addressed store, hash-verified

723}
724
725pub fn new_struct_error(vm: &VirtualMachine, msg: impl Into<String>) -> PyBaseExceptionRef {
726 // can't just STRUCT_ERROR.get().unwrap() cause this could be called before from buffer
727 // machinery, independent of whether _struct was ever imported
728 let msg: String = msg.into();
729 vm.new_exception_msg(struct_error_type(vm).clone(), msg.into())
730}

Callers 7

get_buffer_offsetFunction · 0.85
with_bufferMethod · 0.85
parseMethod · 0.85
pack_intoMethod · 0.85
unpackMethod · 0.85
get_int_or_indexFunction · 0.85
pack_charFunction · 0.85

Calls 3

struct_error_typeFunction · 0.85
new_exception_msgMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected