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