Skip to main content

Packages

Struct Packages 

Source
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 Path

Where ingraph lives, as the declaration named it.

§vis: &'a Visibility

The declaration’s own visibility — what every emitted package takes.

§owner: &'a Ident

WHOSE 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 Ident

The 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>

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Clone for Packages<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Packages<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Send for Packages<'a>

§

impl<'a> !Sync for Packages<'a>

§

impl<'a> Freeze for Packages<'a>

§

impl<'a> RefUnwindSafe for Packages<'a>

§

impl<'a> Unpin for Packages<'a>

§

impl<'a> UnsafeUnpin for Packages<'a>

§

impl<'a> UnwindSafe for Packages<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.