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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// The docs.rs badge half: `doc_cfg` derives the "Available on crate feature `x` only" banner from
// the `cfg` a gated item already carries. This crate declares NO features, so it derives nothing
// today — the attribute is here because the knob that turns it on is, and the two belong together:
// `docsrs` is set by the `rustdoc-args` in `[package.metadata.docs.rs]` below and by nothing else,
// so a root that never named `doc_cfg` would leave that cfg dangling. Nightly-only, hence the
// `cfg_attr`; every stable build compiles a crate that has never heard of `docsrs`.
//! The emission engine behind [`ingraph-derive`](https://docs.rs/ingraph-derive).
//!
//! Model in, tokens out. Nothing here parses: [`model::RecordModel`] is a plain struct with public
//! fields, so the two front ends that will ever build one — the derive today, `ingraph-compiler`
//! from a manifest later — reach the SAME emitter without either of them being this crate's
//! concern. Validation belongs with those front ends, which hold the source spans to report at.
//!
//! The manifest is not this crate's, despite what an earlier draft of this doc said: under the
//! settled architecture a manifest and a GraphQL schema are compiled by `ingraph-compiler` into
//! the decorated declarations these macros expand. This crate is the last step of that pipeline,
//! and the whole of it for a hand-written record.
//!
//! # WHAT THE TOKENS ASSUME ABOUT `ingraph`'s TIERS
//!
//! `ingraph` is cut into tiers — a vocabulary core, then `engine`, then `runtime`, then `derive` —
//! and this crate emits `__private::drive`, `__private::source`, `__private::operator`,
//! `__private::resource` and `__private::retrieve` freely, because the tiers behind those shelf
//! segments are IMPLIED by the feature that supplies the words a declaration is written in. The
//! emitter therefore writes no tier gate at all, and there is no `if_runtime!` to write one with.
//!
//! That is a fact about the framework's feature table rather than a promise this crate makes, and
//! it is what keeps the emitter free of a decision it could not express anyway: a `#[cfg]` written
//! into emitted tokens is evaluated in the DECLARING crate, so it asks a question about somebody
//! else's manifest. The gate family in `ingraph::gate` exists for exactly the conditions that
//! cannot be settled here; the tiers are not among them, because they are settled by implication
//! before an expansion is ever reached.
/// The COMPOSED MODE's model — the wire face of a filter struct somebody wrote by hand, built out
/// of its own fields.
/// THE CONSTRUCTION PROTOCOL's model — the sequence of calls a wrapped type is built by, and the
/// writer that spells one.
/// The ELEMENT MODE's model — a declared element's own filter, and the citizenship it needs.
/// WHERE an elected field is written — the engine blocks, and the `(field × engine)` slots they are.
/// The LEAF ERROR's model — an application's own failure type, dressed to render under its code.
/// The FIELD-FRAGMENT TIER's model — the fields a holder inherits, and the width they occupy.
/// THE FUSION TREE's own emission — the leaf and tier packages a declaration mints, and the
/// `Fusable` impl a parent absorbs them through.
/// THE ID DEVICE's model — the register a `#[repr(transparent)]` id wrapper is equipped
/// with, from the sealed vocabulary's transparency row out to the schema's own scalar.
/// THE MUTATION NODE's model — the command vocabulary a source is controlled through, and the
/// record a source's own expansion reads that declaration through.
/// THE NEWTYPE DEVICE's model — the kits a declared wrapper opts into, and the pass-through row
/// each one installs.
/// THE EMISSION PREFIX — the mark every name this crate mints into a declaration's own scope
/// wears, and the seat a domain framework building these models sets to its own.
/// THE SEARCH RECIPE's model — the members a recipe fuses, the towers bound to them, and the seats
/// one broadcast question is filled at.
/// THE ORIGIN's model — the double entry a source declaration writes between its `mutation` word and
/// the `type Mutation` seat its author's own `impl` fills.
/// The STANDALONE family's model — a hand-written struct's three faces, composed from the units.
/// THE TOWER's model — a question pipeline's two ends, its steps, and the chain the emission
/// demands between them.
/// The FACTORED UNITS the grammar words compose and the standalone derives are the bare doors of.
/// Everything a front end needs, in one `use`.