Available on crate feature
serde only.Expand description
Functions to serialize and deserialize an OrderMap as an ordered sequence.
The default serde implementation serializes OrderMap as a normal map,
but there is no guarantee that serialization formats will preserve the order
of the key-value pairs. This module serializes OrderMap 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 = "ordermap::map::serde_seq")]
map: OrderMap<i32, u64>,
// ...
}Functionsยง
- deserialize
- Deserializes an
OrderMapfrom an ordered sequence. - serialize
- Serializes an
OrderMapas an ordered sequence.