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

Function pack_string

crates/vm/src/buffer.rs:674–678  ·  view source on GitHub ↗
(vm: &VirtualMachine, arg: PyObjectRef, buf: &mut [u8])

Source from the content-addressed store, hash-verified

672}
673
674fn pack_string(vm: &VirtualMachine, arg: PyObjectRef, buf: &mut [u8]) -> PyResult<()> {
675 let b = ArgBytesLike::try_from_object(vm, arg)?;
676 b.with_ref(|data| write_string(buf, data));
677 Ok(())
678}
679
680fn pack_pascal(vm: &VirtualMachine, arg: PyObjectRef, buf: &mut [u8]) -> PyResult<()> {
681 if buf.is_empty() {

Callers 1

pack_intoMethod · 0.85

Calls 2

write_stringFunction · 0.85
with_refMethod · 0.80

Tested by

no test coverage detected