Sometimes I want to work with a Value that I know to be a json object. Map<String, Value> is the correct type to use for this but it is not possible to deserialize from a Map<String, Value> to a more concrete without going through Value. It would be nice if Map<String, Value> implemented Deserializer so this all just works.
My actual use case is that I have a &Map<String, Value> that I would like to deserialize to a concrete struct, which is harder to come up with a workaround for. With an owned value I could just do T::deserialize(Value::Object(map)) but that doesn't work for a reference.
Sometimes I want to work with a
Value
that I know to be a json object.Map<String, Value>
is the correct type to use for this but it is not possible to deserialize from aMap<String, Value>
to a more concrete without going throughValue
. It would be nice ifMap<String, Value>
implementedDeserializer
so this all just works.My actual use case is that I have a
&Map<String, Value>
that I would like to deserialize to a concrete struct, which is harder to come up with a workaround for. With an owned value I could just doT::deserialize(Value::Object(map))
but that doesn't work for a reference.