tuple_vec_map

Function deserialize

Source
pub fn deserialize<'de, K, V, D>(
    deserializer: D,
) -> Result<Vec<(K, V)>, D::Error>
where D: Deserializer<'de>, K: Deserialize<'de>, V: Deserialize<'de>,
Expand description

Deserialize to a Vec<(K, V)> as if it were a HashMap<K, V>.

This directly deserializes into the returned vec with no intermediate allocation.

In formats where dictionaries are ordered, this maintains the input data’s order.