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

Function read_marshal_bytes

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

Read a marshal bytes object (TYPE_STRING = b's').

(rdr: &mut R)

Source from the content-addressed store, hash-verified

277
278/// Read a marshal bytes object (TYPE_STRING = b's').
279fn read_marshal_bytes<R: Read>(rdr: &mut R) -> Result<Vec<u8>> {
280 let type_byte = rdr.read_u8()? & !FLAG_REF;
281 if type_byte != Type::Bytes as u8 {
282 return Err(MarshalError::BadType);
283 }
284 let len = rdr.read_u32()?;
285 Ok(rdr.read_slice(len)?.to_vec())
286}
287
288/// Read a marshal string object.
289fn read_marshal_str<R: Read>(rdr: &mut R) -> Result<alloc::string::String> {

Callers 1

deserialize_codeFunction · 0.85

Calls 5

read_u8Method · 0.80
read_u32Method · 0.80
to_vecMethod · 0.80
read_sliceMethod · 0.80
ErrClass · 0.50

Tested by

no test coverage detected