Crate table[−][src]
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.
Table
s contain Value
s that are indexed by Key
s, 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.
Since Table
s are the only compound data type provided by the crate, they
serve a dual, hybrid purpose as both an unordered map and an ordered list.
While the optimized list implementation and specialized accessors are not
yet available, it is still possible to use Table
s as lists by using
numeric keys.
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/.
Modules
util |
Utilities not directly related to the functionality of this crate, but not provided by an upstream crate. |
Structs
Error |
The crate's common error type. |
IntoIter |
A consuming iterator over the key-value pairs in a table. |
Iter |
A borrowing iterator over the key-value pairs in a table. |
IterMut |
A mutably borrowing iterator over the key-value pairs in a table. |
Table |
A hybrid collection of key-value pairs that can be used as an ordered list or a map. |
Enums
Key |
Defines the types that can be used to index into a table. |
Value |
Defines the types of data that can be stored in a table. |