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

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -