pub struct SearchModel {
pub krate: Path,
pub name: Ident,
pub vis: Visibility,
pub seats: Vec<SeatModel>,
pub dedup: Dedup,
pub limit: Option<NonZeroU32>,
pub graphql: Option<GraphqlKind>,
pub members: Vec<MemberModel>,
}Expand description
A validated search recipe, ready to emit.
PLAIN — no Copy, no comparison — for super::tower::TowerModel’s reason: a model is carried
once, from the pass that validated it to the pass that emits it.
Fields§
§krate: PathThe path to the ingraph crate itself — ::ingraph unless #[ingraph(crate = "…")] named
another.
name: IdentThe declared type — what the recipe’s own faces are minted on.
vis: VisibilityThe declaration’s own visibility, which everything minted beside it takes.
seats: Vec<SeatModel>THE BROADCAST SEATS — shared(text(type = "String"), …), in declaration order.
EMPTY where the head wrote no shared(…) at all, which is the recipe whose arms are each
asked their own question. A seat is what a caller fills once for the whole recipe, and the
arms that read it say so with their own shared word.
SEVERAL are a CHOICE and never a companion: the published field asks with one @oneOf object
and a client fills exactly one seat, so a value that rides WITH a question — a language tag, a
locale — is a field of a seat’s own TYPE rather than a seat beside it. Written as a seat it
would be unaskable beside the question it belongs to. The grammar’s own note carries the
boundary in full; see ingraph-derive’s search module.
dedup: DedupHow this recipe’s fused doors tell two roots apart — dedup(hash).
NOT an Option, and that is the graph root’s own shape one grain down: the absent word is
Dedup::Hash rather than a deferral, because every key an emitted node mints derives
Hash and the join a recipe has always had is the one an unwritten word
still names.
limit: Option<NonZeroU32>How many roots the recipe’s own door answers with when nothing asks otherwise — limit = 20.
None where the word was OMITTED, and it is a deferral rather than a default: the tier
order is request > recipe > election field > container > the framework’s own number, so a
recipe that names none lets the declaration below it answer. Writing the framework’s 20 in
here would make an unwritten word outrank an election that wrote its own.
graphql: Option<GraphqlKind>WHICH BACKEND DRESSES THIS RECIPE — graphql(async_graphql), or None where it named none.
The retrieving family’s presence law at the recipe grain: a recipe with no block emits its
whole Rust surface — the record, the packages, the evidence enums and the door — and mints no
schema. That is what a fused read a deployment drives from Rust wants, and it is also what
keeps the wire face’s own demands off a recipe that publishes nothing: the seams a resolver
reaches its members through (FusedEngine, FusedCitizen, WireRoot) are asked for
only where a field is published.
members: Vec<MemberModel>The members, in declaration order. NEVER EMPTY: a recipe with no member is refused at the front end, there being nothing to ask and nothing to fuse.
Implementations§
Source§impl SearchModel
impl SearchModel
Sourcepub fn fuse(&self) -> TokenStream
pub fn fuse(&self) -> TokenStream
The RECIPE FUSION emission, whole: the tower packages, the two request packages, the evidence and refusal enums, and the door.
UNCONDITIONAL, which is the word-count law’s absence stated as code: a recipe with one member is a recipe that fuses one ranking, and a one-term fold is the fold. What made the root’s emission conditional was that a root’s members arrived by a word rather than by a list, so fewer than two was a state it could be in; a recipe with no member is refused at the front end.
Source§impl SearchModel
impl SearchModel
Sourcepub fn record(&self) -> TokenStream
pub fn record(&self) -> TokenStream
The DeclaredSearch impl, whole.
Source§impl SearchModel
impl SearchModel
Sourcepub fn emit(&self) -> TokenStream
pub fn emit(&self) -> TokenStream
EVERYTHING a recipe mints: the record it states across the expansion wall, and the fusion unit its door runs.
The recipe REPLACES its own declaration, as every attribute macro does, so the host struct is echoed by the front end and what arrives here is only what is added beside it.
Sourcepub fn mounts(&self) -> bool
pub fn mounts(&self) -> bool
WHETHER THIS RECIPE PUBLISHES A QUERY FIELD AT ALL.
Two conditions, and neither counts past zero. A recipe has to have NAMED a backend — the presence law — and it has to broadcast into AT LEAST ONE seat, because the wire road’s question is the seat a client fills and a recipe with none has nothing for that argument to be.
SEVERAL seats used to fail here too, and the @oneOf member seats are what retired that arm:
the published field’s question becomes a choice — one input field per seat, exactly one filled —
and the members whose arms bought that seat answer the request. A recipe with ONE seat publishes
the bare argument it always did, which is the additive law read at the schema.
Sourcepub fn chooses(&self) -> bool
pub fn chooses(&self) -> bool
WHETHER THE PUBLISHED QUESTION IS A CHOICE — several declared seats, so the field asks with
one @oneOf argument rather than with the seat itself.
The fork every wire-side emitter reads, written once: a single-seat recipe’s whole face is what it was before the choice existed, byte for byte, and this is the one predicate that says so.