pub struct Packages<'a> {
pub krate: &'a Path,
pub vis: &'a Visibility,
pub owner: &'a Ident,
pub graphql: Option<&'a IndexGraphql>,
pub base: &'a Ident,
pub members: Vec<(Ident, LitStr)>,
}Expand description
THE PACKAGE EMITTER, at any GRAIN — the options-pattern struct, its wire face, and the two enum faces the fusion tree publishes.
§It was Tier’s, and the ROOT is why it is not
Every one of these emitters was written as a method on Tier while the only thing that minted
a package was an index declaration. A ROOT mints packages too — its members are its routes — and
it is not a tier: it has no kind, no elections and no engines, so it could reach none of this
without carrying an index model it does not have.
What the emitters actually READ off a tier is three things: where the framework lives, what visibility to take, and whose name a refusal quotes. So that is what this holds, and a tier is one caller of it rather than its owner.
Fields§
§krate: &'a PathWhere ingraph lives, as the declaration named it.
vis: &'a VisibilityThe declaration’s own visibility — what every emitted package takes.
owner: &'a IdentWHOSE packages these are, for a refusal that has to name the declaration at fault — an index at tier grain, a root at root grain.
graphql: Option<&'a IndexGraphql>WHICH BACKENDS DRESS THESE PACKAGES — the declaration’s graphql(…) block, or None at a
grain whose grammar has no block (the root today), which the skin law reads as undressed: the
Rust surface emits whole and no wire face is minted.
base: &'a IdentThe RENAME-AWARE BASE every minted name leads with — the tier’s base, the
root’s own ident. What sdl’s re-basing swaps out.
members: Vec<(Ident, LitStr)>EVERY PER-FACE OVERRIDE this declaration wrote, as the minted Rust name it targets paired with the word a schema is to publish instead.
§One list where there used to be a fixed three, because the seats stopped being three
The head’s options/question/engine were the whole vocabulary and a [_; 3] zipped
against them read fine. The 2026-08-16 rename ruling added question(rename = …) and
engines(rename = …) on every ELECTION, so the count is now one grain’s three plus two per
election — a number no array can be sized to. A list of resolved PAIRS also moves the which
word belongs to which mint decision to the one place that knows both, so sdl
answers by lookup rather than by re-deriving names it would have to keep in step.
EMPTY at a grain whose grammar has no block — the root today — which is the same state a declaration that wrote no override is in.
Implementations§
Source§impl<'a> Packages<'a>
impl<'a> Packages<'a>
Sourcepub fn package(&self, name: &Ident, subject: &str, rows: &[Row]) -> TokenStream
pub fn package(&self, name: &Ident, subject: &str, rows: &[Row]) -> TokenStream
ONE PACKAGE, whole: the struct, its factory chain, its readers, its Default and its wire
face — over the rows that HAVE one, which is Row::rust_side’s whole subject.
§BOTH trees cross now, and the grain is the ROW
Every row of an options package crosses: a count, a fold word, a flavour request, an engine
choice, another package. The question tree’s rows are all but one — a question is a String
and a child route is another question package — and the exception is coordinates, which is
the declaration’s own Embedding<E, N, S> and has no InputType to cross on. Refusing the
whole sister tree for that one row published nothing where the text half was always
publishable, so the exclusion moved down a level.
Sourcepub fn question(&self, name: &Ident, subject: &str, rows: &[Row]) -> TokenStream
pub fn question(&self, name: &Ident, subject: &str, rows: &[Row]) -> TokenStream
ONE QUESTION PACKAGE — package under the sister tree’s name, so a reader
scanning the emitters sees which tree is being built.
Sourcepub fn oneof(
&self,
name: &Ident,
stem: &Ident,
variants: &[(Ident, Ident, String)],
) -> TokenStream
pub fn oneof( &self, name: &Ident, stem: &Ident, variants: &[(Ident, Ident, String)], ) -> TokenStream
The @oneOf a slot’s engine row holds — the enum over the declared typed words, and the
input face that publishes it as a CHOICE rather than as a record of optional fields.
Hand-written for input_face’s reason, and against
async_graphql::OneofObject’s own expansion: oneof: true in the meta type, one nullable
input field per variant, a parse that admits an object of EXACTLY ONE key, and the two marker
impls a @oneOf carries beside InputType.
Sourcepub fn enum_face(
&self,
name: &Ident,
variants: &[&Ident],
words: &[String],
) -> TokenStream
pub fn enum_face( &self, name: &Ident, variants: &[&Ident], words: &[String], ) -> TokenStream
The WIRE FACE of an emitted enum — the name/variant table and the input crossing, written the
way enumeration::wire writes an ingraph::Enum’s.
SCREAMING_SNAKE on the wire, which is the GraphQL namespace’s own default casing in this grammar and is reached here rather than restated.