impl<K, V> Serialize for MyMap<K, V>
where K: Serialize,
V: Serialize
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer
{
let mut state = serializer.serialize_map(Some(self.len()))?;
for (k, v) in self {
state.serialize_entry(k, v)?;
}
state.end()
}
}