This deserializers can be used to delegate deserialization to another
type's visitor.
Example:
```json
fn visit_map<V>(&mut self, visitor: V) -> Result<Self::Value, V::Error>
where V: de::MapVisitor
{
let mut deserializer = de::value::MapVisitorDeserializer::new(visitor);
try!(Deserialize::deserialize(&mut deserializer))
}
```
This makes it possible to remove the `From<de::value::Error>` trait
bound from the `de::Error` trait.
An example for using a `ValueDeserializer` to forward deserializing to
another type's visitor:
```rust
fn visit_u8<E>(&mut self, value: u8) -> Result<Self::Value, E>
where E: de::Error
{
try!(Deserialize::deserialize(&mut value.into_deserializer()))
}
```
Please note that there is an regression in serde-rs/json which needs to
be fixed.
When using a `ValueDeserializer` errors produced with the methods
`type_mismatch`, `length_mismatch` and `syntax` were not forwarded
correctly. These methods now store all information in the enum
`de::value::Error`.
The key parameter of the insert functions are of type String now.
As insert requires ownership of its parameter `key` and StrAllocating
being gone in rust these functions now communicate that ownership
in their signature.
As a result &str must be converted into a String at the caller instead
of the callee.
The Trait ToOwned isn't an alternative as it's a generalized Clone.
StrAllocating simply has hidden an allocation or move.
The key parameter of the insert functions are of type String now.
As insert requires ownership of its parameter `key` and StrAllocating
being gone in rust these functions now communicate that ownership
in their signature.
As a result &str must be converted into a String at the caller instead
of the callee.
The Trait ToOwned isn't an alternative as it's a generalized Clone.
StrAllocating simply has hidden an allocation or move.