Function indexmap::map::serde_seq::serialize

source ·
pub fn serialize<K, V, S, T>(
    map: &IndexMap<K, V, S>,
    serializer: T
) -> Result<T::Ok, T::Error>
where K: Serialize + Hash + Eq, V: Serialize, S: BuildHasher, T: Serializer,
Available on crate feature serde only.
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::map::serde_seq::serialize")]
    map: IndexMap<i32, u64>,
    // ...
}