Skip to main content

substrate_data/schema/
mod.rs

1//! Schemas: a format is a Rust type implementing [`Schema`] (usually
2//! `#[derive(Schema)]`). One schema reads and writes the format, checks it
3//! with the path of every problem, collects its references for the build to
4//! check, and describes itself ([`Shape`]) for editors (property grids, completion) and the
5//! docs.
6
7mod convert;
8mod description;
9mod dictionary;
10mod expand;
11mod fields;
12mod format;
13mod named_type;
14mod plain;
15mod reader;
16mod refs;
17mod shape;
18mod tagged;
19pub mod with;
20
21#[cfg(feature = "toml")]
22pub use convert::from_toml;
23pub use convert::{
24    field_names, from_bytes_with, from_doc, from_doc_with, from_text, from_value, from_value_with,
25    placed, read_both, read_bytes, read_ref_value, read_value, to_bytes, to_bytes_into, to_text,
26};
27pub use description::{DefinitionDoc, FieldDoc, ShapeDoc, ShapeNode, VariantDoc};
28pub use dictionary::Dictionary;
29pub use fields::{Fields, field_name};
30pub use format::Schema;
31pub use named_type::{NamedShape, NamedType, read_named};
32pub use plain::{OneOrList, Ordered, RESULT_ERR, RESULT_OK};
33pub use reader::{
34    COMMENT_KEY, Expansion, Expected, Found, MAX_EXPANSION_DEPTH, META_PREFIX, Numbers,
35    PRIVATE_PREFIX, Read, Reader, Resolve, Unresolved, is_metadata_key,
36};
37pub use refs::{Id, Kind, Kinds, RefId, Uid, read_id, read_ref, ref_shape};
38pub use shape::{EnumShape, Field, Shape, ShapeFn, StructShape, Variant};
39pub use tagged::{WRAPPED, flattens};