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 fields;
10mod format;
11mod named_type;
12mod plain;
13mod reader;
14mod refs;
15mod shape;
16mod tagged;
17pub mod with;
18
19#[cfg(feature = "toml")]
20pub use convert::from_toml;
21pub use convert::{
22    field_names, from_doc, from_doc_with, from_text, from_value, from_value_with, placed,
23    read_both, read_bytes, read_ref_value, read_value, to_bytes, to_text,
24};
25pub use description::{DefinitionDoc, FieldDoc, ShapeDoc, ShapeNode, VariantDoc};
26pub use fields::{Fields, field_name};
27pub use format::Schema;
28pub use named_type::{NamedShape, NamedType, read_named};
29pub use plain::{OneOrList, Ordered};
30pub use reader::{
31    COMMENT_KEY, Expected, Found, META_PREFIX, Numbers, PRIVATE_PREFIX, Read, Reader, Resolve,
32    Unresolved, is_metadata_key,
33};
34pub use refs::{Id, Kind, Kinds, RefId, Uid, read_id, read_ref, ref_shape};
35pub use shape::{EnumShape, Field, Shape, ShapeFn, StructShape, Variant};
36pub use tagged::{WRAPPED, flattens};