1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! `#[derive(Schema)]` — see `substrate_data::Schema`.
//!
//! - A struct with named fields is an object. Field attributes:
//! `#[data(rename = "name")]`, `#[data(default)]` /
//! `#[data(default = "path::to_fn")]`, `#[data(skip)]` (never read or
//! written; `Default`). `Option` fields may be left out.
//! - A struct with one unnamed field is that field's format.
//! - An enum of unit variants is a string: the variant's name in
//! `snake_case`, or `#[data(rename = "...")]`.
//! - `#[data(tag = "type")]` on an enum: an object whose `type` names the
//! variant; a variant is a unit, has named fields, or wraps one value —
//! a struct's fields sit next to the tag, anything else under `value`
//! (`substrate_data::schema::WRAPPED`).
//!
//! - `#[data(view)]` on a struct: `NameView<'a>` too, the struct read out
//! of a frame without copying (`substrate_data::frame::View`).
//!
//! Every type also packs itself into frames (`pack` / `unpack`: fields by
//! position, unit enums by index) and writes the binary form straight
//! (`encode` / `decode`).
//!
//! Doc comments become the shape's docs (an editor's hover text and the
//! docs' field tables).
use TokenStream;
use ;
/// `#[derive(Schema)]`: see the crate's docs.
;