rust - serde_json - how to make my struct convertable from / to json? -


looking @ the documentation of serde_json, can't understand trait have implement make struct serializiable , deserializiable json. obvious answer deserializer , serializer these structs, not traits.

with rustc-serialize implement tojson , fromjson traits.

from crate index page:

serde provides mechanism low boilerplate serialization & deserialization of values , json via serialization api. able serialize piece of data, must implement serde::serialize trait. able deserialize piece of data, must implement serde::deserialize trait. serde provides provides annotation automatically generate code these traits: #[derive(serialize, deserialize)].

-- type-based serialization , deserialization


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -