-
Notifications
You must be signed in to change notification settings - Fork 108
Add pop method to json Decoder #44
Comments
Note: Decodable is not a generic trait. The decode function is generic instead. Obviously Note2 does not work to decode arbitrary json formats, only those that also were encoded by a derived Encodable trait. As the decoder could also be any other decoder (like a binary decoder), the type of the field to read might not be available. Implementing a generic pop is therefor not possible. Making the pop method from json::Decoder public and waiting for negative trait bounds might work (rust-lang/rfcs#586). |
I'm going to close this now that this crate is deprecated in favor of serde. We're discontinuing feature development in rustc-serialize but will still continue to merge bug fixes if they arise. |
Issue by yaitskov
Thursday Sep 18, 2014 at 20:14 GMT
For earlier discussion, see rust-lang/rust#17377
This issue was labelled with: in the Rust repository
Now it's impossible to implement Decodable for a map with different value types
because read_* methods lose the stack head anyway.
Decodable doesn't have a method returning the stack head as-is without any type casting.
Let's look a case where Json dictionary has values with int and String types.
The text was updated successfully, but these errors were encountered: