A typical need of any software application is to input/output data by reading/writing data files or data streams or by querying/manipulating a database. Regarding files and streams, unstructured data, or even binary data, is hard to manipulate, and so they are not recommended.
Also, proprietary data formats are not recommended because of the vendor lock-in risk, and so only standard data formats should be used. Fortunately, there are free Rust libraries that come to the rescue in these situations. There are Rust crates available to manipulate some of the most popular file formats, such as TOML, JSON, and XML.
In terms of databases, there are Rust crates to manipulate data using some of the most popular databases, such as SQLite, PostgreSQL, and Redis.
In this chapter, you will learn about the following:
- How to read configuration data from a TOML file
- How to read or write a JSON data file
- How to read an XML data file
- How to query or manipulate data in a SQLite database
- How to query or manipulate data in a PostgreSQL database
- How to query or manipulate data in a Redis database