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

Function read_marshal_const_tuple

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

Read a marshal tuple of constants.

(
    rdr: &mut R,
    bag: Bag,
)

Source from the content-addressed store, hash-verified

331
332/// Read a marshal tuple of constants.
333fn read_marshal_const_tuple<R: Read, Bag: ConstantBag>(
334 rdr: &mut R,
335 bag: Bag,
336) -> Result<Constants<Bag::Constant>> {
337 let type_byte = rdr.read_u8()? & !FLAG_REF;
338 let n = match type_byte {
339 b'(' => rdr.read_u32()? as usize,
340 b')' => rdr.read_u8()? as usize,
341 _ => return Err(MarshalError::BadType),
342 };
343 (0..n).map(|_| deserialize_value(rdr, bag)).collect()
344}
345
346pub trait MarshalBag: Copy {
347 type Value: Clone;

Callers 1

deserialize_codeFunction · 0.85

Calls 6

deserialize_valueFunction · 0.85
read_u8Method · 0.80
read_u32Method · 0.80
collectMethod · 0.80
ErrClass · 0.50
mapMethod · 0.45

Tested by

no test coverage detected