Skip to main content

Crate omnist

Crate omnist 

Source
Expand description

§omnist

Rust implementation of the Omnist data-interchange specification.

Omnist provides a single canonical, lossless data model (document::Doc) across five supported formats (JSON, YAML, TOML, XML, and OML), paired with an algebraic schema language (OSD, schema::Schema) for schema validation, type inference, normalization, subschema extraction, and compatibility checking.

Treat the vendored omnist-spec specification as the normative source of truth for all data model rules, format mappings, and schema algebra.

Re-exports§

pub use error::DocumentError;
pub use error::FormatError;
pub use error::MaterializeError;
pub use error::OmnistError;
pub use error::ParseError;
pub use error::SchemaError;
pub use error::WriteError;
pub use infer::AnyFallback;
pub use infer::infer;
pub use infer::infer_with_report;
pub use materialize::materialize;
pub use registry::Format;
pub use registry::formats;
pub use registry::get_format;
pub use registry::register_format;
pub use report::Adjustment;
pub use report::Severity;
pub use report::WriteReport;

Modules§

document
The Document model — a canonical tree of ordered, labeled edges.
error
Error hierarchy, thiserror-based (per issue #1 §5).
formats
Codecs over the canonical Document model. Ported from ~/dev/omnist/omnist/formats.py; each format’s reader parses text into crate::document::Doc and its writer projects a Doc back to text.
infer
Schema inference: draft a record Schema that accepts a set of sample Documents.
materialize
Schema-directed deserialization: make a freshly-read RawNode conform to a Schema, or report every reason it doesn’t.
oml
OML (Omnist Markup Language) – the native codec for the Document model.
ops
Schema algebra: prune, minimize/normalize, subschema, extract, lint, isomorphic, signature – ported from ~/dev/omnist/omnist/ops/ (issue #12), one module per op (matching the Python layout, which is already a reasonable structure per “architecture freedom”).
osd
OSD (Omnist Schema Definition) – the text language for the crate::schema model. Ported from ~/dev/omnist/omnist/osd.py.
registry
Format registry – read/write/check a crate::document::Doc by format name at runtime, plus register your own format plugins. Ported from ~/dev/omnist/omnist/registry.py (issue #31; see also the TypeScript port’s registry.ts for the same architecture-freedom call made there).
report
Adjustment reports for lossy writes.
schema
The Schema model – Record/Scalar/Ref, per docs/design/model.md (issue #6). Ported from ~/dev/omnist/omnist/schema.py.

Constants§

VERSION
The version of the omnist crate, matching Cargo.toml.