-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
This is what I have in mind at the moment (but we should try to reduce the number of topics by merging some of them)
- Custom Encoding/Decoding (to Structs)
- Decoding from &str
- Default Decoding/Encoding
#[deriving(Encodable,Decodable)] - Encoding to String
- Error handling (
DecoderError,ParserError, etc) - Streaming (which is not documented)
- The
Jsonintermediate struct -
ToJson - How JSON types match to Rust types:
null<->None,[]<->Vec,""<->String, Object <->TreeMap<String, T>/HashMap<String, T>
Feedback is welcome!
Order-wise, this chapter should be after the "hashmap"/"treemap" chapters.
The structure of the chapter should look like this (some topics are still missing):
.
|-- `Json` -> The `Json` enum and its variants
| |-- Decoding -> `json::from_str` + `BuilderError`
| |-- `ToJson`` -> struct -> `Json`
| `-- Stringify??? -> `Json` -> `String`
|-- `Decoder` -> `Json` -> `Decoder` -> `T` - where `T` = `Vec`, `String`, `HashMap`, etc
|-- `Decodable` -> `#[deriving(Decodable)]`
| `-- Custom??? -> Manually implement `Decodable`
`-- `Encodable` -> `#[deriving(Encodable)]`, `str_encode`
`-- Custom??? -> Manually implement `Encodable`
@vojtechkral is working on this
Metadata
Metadata
Assignees
Labels
No labels