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

Chapter 11 - Parsing and Serialization

Parsing is a well-researched technique of making sense of a linear sequence of data, usually a string. Serialization is turning an internal representation of data to a linear sequence, and deserialization is vice versa. Parsing and serialization are easy to confuse, since parsing techniques are usually employed in deserialization.

Parser combinators are tools that allow making large parsers out of smaller ones. Examples of such libraries written in and for Rust include nom and Chomp. Another useful tool is parser expression grammar or PEG. One library that implements a PEG is called Pest.

Serde is the de facto standard library for creating (de)serializators in Rust.

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