Lines Matching defs:map
54 /// serialize the map to parcel
55 pub fn serialize_map(map: &AssetMap, parcel: &mut MsgParcel) -> Result<()> {
56 if map.len() as u32 > MAX_MAP_CAPACITY {
57 return log_throw_error!(ErrCode::InvalidArgument, "[FALTAL][IPC]The map size exceeds the limit.");
59 parcel.write(&(map.len() as u32)).map_err(ipc_err_handle)?;
60 for (&tag, value) in map.iter() {
79 /// deserialize the map from parcel
83 return log_throw_error!(ErrCode::InvalidArgument, "[FATAL][IPC]The map size exceeds the limit.");
85 let mut map = AssetMap::with_capacity(len as usize);
92 map.insert(tag, Value::Bool(v));
96 map.insert(tag, Value::Number(v));
100 map.insert(tag, Value::Bytes(v));
104 Ok(map)
107 /// Serialize the collection of map to parcel.
113 for map in vec.iter() {
114 serialize_map(map, parcel)?;
119 /// Deserialize the collection of map from parcel.