Skip to main content

structom/
lib.rs

1//! the official library for working with structom for the rust language
2//! ## structom
3//! structom (StructuredAtoms) is a lightweight general data exchange format designed for universal applications, from small human readable object files to large scale data serialization.
4//!
5//! structom has 3 different forms for data representation:
6//! - object notation: consize human readable systax for data manipulated by humans.
7//! - binary objects: effecient direct form for shcemaless data.
8//! - serialized structs: flattern form for performant data serialization.
9//!
10//! structom provide additional rich data structures (tagged unions), supports both schema and schemaless data, and provide support for user defined erased metadata for richer data representation.
11//!
12//! structom is designed to be very versatile and expressive, while remaining efficient and performant, adapting for any need from high level rich data notation to low level effecient serialization.
13//!
14//! read more about the structom format in its [specification](https://github.com/aliibrahim123/structom/blob/main/spec/index.md).
15//!
16//! ## features
17//! this crate provides the following features for working with structom:
18//! - parsing and stringifying object notation files.
19//! - decoding and encoding binary files.
20//! - manipulating and creating structom values.
21//! - supports both schema and schemaless data.
22//! - parsing and managment of decleration files.
23//! - provide runtime for the serialization code generated by codegen.
24//!
25//! this crate supports every feature of the structom specification.
26
27pub(crate) mod builtins;
28mod declaration;
29pub mod encoding;
30mod errors;
31mod fs_decl_provider;
32mod parser;
33mod stringify;
34mod value;
35
36pub use declaration::{
37	DeclFile, DeclProvider, FixedSetProvider, FixedSetProviderRef, VoidProvider,
38};
39pub use encoding::{Serialized, decode, encode};
40pub use errors::ParserError;
41pub use fs_decl_provider::{FSProvider, LoadFileError};
42pub use parser::{ParseOptions, parse, parse_declaration_file};
43pub use stringify::{StringifyOptions, stringify};
44pub use value::{Key, Value};
45
46#[doc(hidden)]
47pub mod internal {
48	pub use crate::builtins::*;
49	pub use crate::declaration::{DeclItem, EnumVariant, Field, StructDef, TypeId};
50}