Module indexmap_nostd::serde_seq
source · [−]Expand description
Functions to serialize and deserialize an IndexMap
as an ordered sequence.
The default serde
implementation serializes IndexMap
as a normal map,
but there is no guarantee that serialization formats will preserve the order
of the key-value pairs. This module serializes IndexMap
as a sequence of
(key, value)
elements instead, in order.
This module may be used in a field attribute for derived implementations:
#[derive(Deserialize, Serialize)]
struct Data {
#[serde(with = "indexmap_nostd::serde_seq")]
map: IndexMap<i32, u64>,
// ...
}
Requires crate feature "serde"
.
Functions
Deserializes an IndexMap
from an ordered sequence.