indexmap::serde_seq

Function deserialize

Source
pub fn deserialize<'de, D, K, V, S>(
    deserializer: D,
) -> Result<IndexMap<K, V, S>, D::Error>
where D: Deserializer<'de>, K: Deserialize<'de> + Eq + Hash, V: Deserialize<'de>, S: Default + BuildHasher,
Expand description

Deserializes an IndexMap from an ordered sequence.

This function may be used in a field attribute for deriving Deserialize:

#[derive(Deserialize)]
struct Data {
    #[serde(deserialize_with = "indexmap::serde_seq::deserialize")]
    map: IndexMap<i32, u64>,
    // ...
}

Requires crate feature "serde" or "serde-1"