Crate json_tables

source ·
Expand description

This crate deals with having to store potentially large amounts of information in a human readable and editable format (short json files). Databases are excluded because of the human readable part, and so are excruciatingly long files.

In order to manage that information inside a program we propose the Table<T> structure. It can manage information of type <T> that can be serialized and deserialized by serde. For that purpose the traits and derive macros are reexported. (So that there is no need to explicitly depend on serde to use this crate)

Structs

Main structure of this crate. Holds the information from the table. It reads all at once, so huge tables will be slow and memory intensive
A builder that creates new tables and opens existing tables. The default TableBuilder configures the table to ignore write back automatically, ignore non json files, and report errors when deserialization cant be completed
The structure that’s stored in the internal hash_map. It contains a file and the content of the file. You can only access the information and not the file
A compilation of all the policies of a Table

Enums

Whether to give an error when a file can’t be deserialized to the intended structure
How to treat the file extensions
Weather you can write or not with a table.
Error trying to create a new table
Errors during the management of a table
Whether the write operation is performed on drop or not

Traits

A data structure that can be deserialized from any data format supported by Serde.
A data structure that can be serialized into any data format supported by Serde.

Derive Macros