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 atom;
17pub mod binary;
18mod borrowed;
19pub mod export;
20pub mod frame;
21pub mod io;
22#[cfg(feature = "json")]
23pub mod json;
24pub mod patch;
25mod stream;
26pub mod text;
27#[cfg(feature = "toml")]
28pub mod toml;
29pub mod typed;
30mod value;
31pub mod with;
32
33pub use atom::Atom;
34pub use borrowed::{MapRef, ValueRef};
35pub use bumpalo::Bump;
36pub use stream::{Stream, StreamWriter};
37pub use text::{Doc, LineCol, Span, Spans, SyntaxError};
38pub use value::{Map, Path, Ref, Res, Seg, Value};
39pub mod schema;
40pub mod source;
41
42pub use schema::{
43    AnyRefOrTag, BlockId, Color, EntityId, Errors, Id, Image, ItemId, ItemIdOrTag, Kind, Kinds,
44    OneOrList, OneOrTag, Ordered, Read, Reader, RecipeId, Resolve, Schema, Shape, TagId, Text,
45    built_in, from_doc_with, from_text, from_value, from_value_with, kinds, read_bytes,
46    read_ref_value, read_value, to_bytes, to_text,
47};
48pub use yog_data_derive::Schema;