Change the JSON API function to be from a serialised struct

This is the first experiment towards using structs to define the API.
It adds it as a new method on the existing Chat struct.

The types in this struct could improve as well as many other things.
But this is a straight forward translation of the existing json! macro
into a struct.
This commit is contained in:
Floris Bruynooghe
2019-12-18 22:49:45 +01:00
committed by Floris Bruynooghe
parent f2f8898004
commit ec40dd1b6f
4 changed files with 144 additions and 55 deletions

1
Cargo.lock generated
View File

@@ -743,6 +743,7 @@ dependencies = [
"human-panic 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]