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

Function read_pstring

crates/compiler-core/src/marshal.rs:1025–1031  ·  view source on GitHub ↗

Read a 4-byte-length-prefixed byte string.

(rdr: &mut R)

Source from the content-addressed store, hash-verified

1023
1024/// Read a 4-byte-length-prefixed byte string.
1025pub fn read_pstring<R: Read>(rdr: &mut R) -> Result<&[u8]> {
1026 let n = read_i32(rdr)?;
1027 if n < 0 {
1028 return Err(MarshalError::InvalidBytecode);
1029 }
1030 rdr.read_slice(n as u32)
1031}
1032
1033const CO_FAST_LOCAL: u8 = 0x20;
1034const CO_FAST_CELL: u8 = 0x40;

Callers

nothing calls this directly

Calls 3

read_i32Function · 0.85
read_sliceMethod · 0.80
ErrClass · 0.50

Tested by

no test coverage detected