Releases: serde-rs/json
Releases · serde-rs/json
v0.9.10
v0.9.9
v0.9.8
-
Implement serde::Deserializer for &serde_json::Value (#261)
This can be convenient for deserializing from indexed content:
let v = json!({ "m": { "serde": 1, "json": 100 } }); let m: BTreeMap<String, u8> = Deserialize::deserialize(&v["m"])?;
-
Add an entry API to the serde_json::Map type, just like what BTreeMap has (#236)
let mut map = serde_json::Map::new(); map.entry("serde").or_insert(json!(12)); match map.entry("serde") { Entry::Vacant(vacant) => { // can insert } Entry::Occupied(occupied) => { // can read, mutate, remove } } assert_eq!(map["serde"], 12);
-
Quit using voldemort types to parameterize the deserializer; this should make storing serde_json::Deserializer and StreamDeserializer in structs more convenient (#260)
v0.9.7
-
Expose
serde_json::de::Read
to simplify certainwhere
clauses (#250)pub struct Client<R> { reader: StreamDeserializer<R, serde_json::Value>, } fn f<R>(c: Client<R>) where R: serde_json::de::Read { /* ... */ }
-
Some convenient new
From
impls (#253, thanks @killercup)- From for Value
- From for Value
- From<&str> for Value
- From<Cow> for Value
- From<Map<String, Value>> for Value
- From<Vec> for Value where T: Into
- From<&[T]> for Value where T: Clone + Into
- FromIterator for Value where T: Into
-
Support deserializing strings as raw bytes (#257, thanks @bennofs)
v0.9.6
-
Allow mutable square-bracket indexing into a serde_json::Value (#249)
let mut data = json!({ "x": 0 }); // replace an existing key data["x"] = json!(1); // insert a new key data["y"] = json!([false, false, false]); // replace an array value data["y"][0] = json!(true); // inserted a deeply nested key data["a"]["b"]["c"]["d"] = json!(true);
v0.9.5
v0.9.4
v0.9.3
- Impl Default for Value; the default Value is Value::Null (#226, thanks @killercup)
- Fix a bug that could successfully deserialize enums from invalid JSON (#230, thanks @killercup)
- Allow
to_value
to serialize maps with integer keys, matching the behavior ofto_string
(#231, thanks @killercup) - Impl PartialEq for Value to simplify comparisons with various primitive types (#235, thanks @imp)