Read a marshal tuple of constants.
(
rdr: &mut R,
bag: Bag,
)
| 331 | |
| 332 | /// Read a marshal tuple of constants. |
| 333 | fn 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 | |
| 346 | pub trait MarshalBag: Copy { |
| 347 | type Value: Clone; |
no test coverage detected