O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Serde

Serde is the de facto standard generic serialization and deserialization library. Serialization means transforming a data structure into structured text (which could be, for instance, JSON, YAML, or a custom data format), while deserialization does the same in the other direction.

Note that there's an earlier library, bundled with the Rust compiler, called rustc-serialize. You might bump into it when looking at some older pieces of code. The rustc-serialize library is no longer needed for serialization, not since stable Rust gained macros 1.1, which fully implements the parts needed for Serde.

Using Serde is conceptually very simple. Serde has two traits: Serialize and Deserialize. Any struct that implements Serialize can be serialized ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required