5 releases (3 breaking)

Uses old Rust 2015

0.4.0 Sep 20, 2018
0.3.0 Sep 8, 2018
0.1.1 Sep 28, 2015
0.1.0 Sep 28, 2015
0.0.2 May 1, 2015

#710 in Data structures

46 downloads per month

GPL-3.0 license

84KB
2K SLoC

table

Tables are a special type of map that store named values of varying types.

This is extremely useful for storing arbitrary configuration or data, as many common file formats (like JSON, TOML, YAML) use maps with keys that are strictly strings and values that can be any primitive or a sequence/map thereof.

License

Copyright (C) 2018 Project Tsukurou!

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.


lib.rs:

The Table is a dynamic, compound data type that is designed to be able to represent any kind of structured data. This is especially useful in cases where the structure of data can't be precisely known at compile-time.

Tables contain Values that are indexed by Keys, both being enums that define the types that are valid for each use case. Key tends to be a limited subset of Value: some types represented by Value aren't hashable, but there aren't many Key types that wouldn't also make sense as a Value type.

The second, maybe-equally-important data type is the List, an ordered, contiguous sequence of values that may be indexed similar to Table but is limited to nonnegative integer keys. Lists are always indexed starting at zero (0); since they are also contiguous, the range of indices of a List with length n is 0..n.

While the crate is named after its Table data type, Values are just as useful, if not more, since they can be tables themselves along with any of the primitive types. The Value type is also fully compatible with serde; it acts as both a (de)serializable and a (de)serializer, meaning it is an intermediate data format that can be converted to/from other data formats and to/from other (de)serializables. This makes it useful as a format for storing arbitrary data from any other format like JSON, YAML, or TOML.

License

Copyright (C) 2018 Project Tsukurou!

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Dependencies

~110–355KB