Expand description
TeaLeaf - Schema-aware data format
§Example
use tealeaf::{TeaLeaf, Value};
let doc = TeaLeaf::parse(r#"
@struct user (id: int, name: string)
users: @table user [
(1, alice),
(2, bob),
]
"#).unwrap();
let users = doc.get("users").unwrap();Re-exports§
pub use convert::ToTeaLeaf;pub use convert::FromTeaLeaf;pub use convert::ConvertError;pub use convert::ToTeaLeafExt;pub use builder::TeaLeafBuilder;
Modules§
- builder
- Builder for constructing TeaLeaf documents from multiple DTOs.
- convert
- DTO conversion traits for TeaLeaf documents
Structs§
- Field
- Field
Type - Index
Map - A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
- Lexer
- Parser
- Reader
- Binary format reader with mmap support for zero-copy access
- Schema
- Schema
Inferrer - Schema inferrer that analyzes data and generates schemas
- TeaLeaf
- A parsed TeaLeaf document
- Token
- Union
- A discriminated union type
- Variant
- A variant in a union type
- Writer
Enums§
Constants§
- HEADER_
SIZE - MAGIC
- MAX_
ARRAY_ LENGTH - Maximum number of elements in an array (u32 encoding limit)
- MAX_
OBJECT_ FIELDS - Maximum number of fields in an object/struct (u16 encoding limit)
- MAX_
STRING_ LENGTH - Maximum length of a string in the string table (u32 encoding limit)
- VERSION
- Library version string (beta/RFC stage)
- VERSION_
MAJOR - Binary format version (major) - for compatibility checks
- VERSION_
MINOR - Binary format version (minor) - for compatibility checks
Functions§
- dumps
- dumps_
with_ schemas - Serialize data to TeaLeaf text format with schemas
- loads
- Convenience: load and get data
- open
- Read a binary TeaLeaf file
- parse
- Parse TeaLeaf text