Skip to main content

yog_data/
lib.rs

1//! Yog Data: one data model, text syntax, binary form and schema system for
2//! every Yog format, the build, the ABI and the IDE — the way Minecraft has
3//! NBT. See `docs/design/yog-data.md`.
4//!
5//! - [`Value`]: the model — JSON's values plus typed ones (content
6//!   references, tags, mod resources, Yog text, images, colors);
7//! - [`text`]: JSON with comments, trailing commas and unquoted keys,
8//!   parsed with the position of every value;
9//! - [`typed`]: the one grammar of the typed values' string forms
10//!   (`@item:minecraft:stick`, `@tag:item:minecraft:planks`, `@Strings.title`);
11//! - [`binary`]: the compact tagged form content crosses the ABI in.
12
13// `::yog_data::…` paths of `#[derive(Schema)]` work inside this crate too.
14extern crate self as yog_data;
15
16pub mod binary;
17pub mod text;
18#[cfg(feature = "toml")]
19pub mod toml;
20pub mod typed;
21mod value;
22
23pub use text::{Doc, LineCol, Span, Spans, SyntaxError};
24pub use value::{Map, Path, Ref, Res, Seg, Value};
25pub mod schema;
26
27pub use schema::{
28    BlockId, Color, EntityId, Errors, Id, Image, ItemId, ItemIdOrTag, Kind, OneOrTag, Ordered,
29    Read, Reader, RecipeId, Schema, Shape, TagId, Text, from_text, from_value, kinds, to_text,
30};
31pub use yog_data_derive::Schema;