pub fn serialize<K, V, T>(
    map: &IndexMap<K, V>,
    serializer: T
) -> Result<T::Ok, T::Error> where
    K: Serialize + Ord,
    V: Serialize,
    T: Serializer
Expand description

Serializes an IndexMap as an ordered sequence.

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

#[derive(Serialize)]
struct Data {
    #[serde(serialize_with = "indexmap_nostd::serde_seq::serialize")]
    map: IndexMap<i32, u64>,
    // ...
}

Requires crate feature "serde".