pub struct TowerModel {
pub krate: Path,
pub name: Ident,
pub vis: Visibility,
pub question: Option<Type>,
pub answer: Option<Type>,
pub steps: Vec<StepModel>,
}Expand description
A validated tower declaration, ready to emit.
PLAIN, for StepModel’s reason.
Fields§
§krate: PathThe path to the ingraph crate itself — ::ingraph unless #[ingraph(crate = "…")] named
another.
name: IdentThe declared type — what the connectivity is stated over and what the walk is minted on.
vis: VisibilityThe declaration’s own visibility, which the walk takes: a tower nobody outside the crate can name has no walk anybody outside it could call.
question: Option<Type>What the WHOLE tower is asked — the question(type = "…") word, and the first step’s
question.
None where the word was OMITTED, on StepModel::answer’s road: the tower is then asked
what its FIRST STEP is canonically asked, <Ty as DefaultServe>::Question.
answer: Option<Type>THE HEAD PIN — the answer = "…" word at the tower, and the one word in this model that
DECIDES NOTHING.
A tower answers what its LAST STEP answers, whatever is written here: this seat holds an author’s stated INTENT, and what the emission does with it is demand that the derivation agree. See the module note for the double entry it is one half of.
None where the word was omitted, under which nothing is emitted and nothing is demanded —
so it is the one seat whose absence costs a declaration not one token.
steps: Vec<StepModel>The steps, in declaration order. NEVER EMPTY: a tower with no step is refused at the front end, there being no chain to state and no answer to name.
Implementations§
Source§impl TowerModel
impl TowerModel
Sourcepub fn emit(&self) -> TokenStream
pub fn emit(&self) -> TokenStream
The CONNECTIVITY, the HEAD PIN, the TWO OPTIONS OBJECTS, the RECORD, the REFUSAL SUM, the WALK and the ASSEMBLY ROW — see the module note for what each says.
The pin comes second because it is a claim ABOUT the impl above it, and it is Option
because a tower that wrote no head word emits nothing here at all. The assembly row comes LAST
because it is the only one that CALLS another: its run is the walk above it at a fixed arity.
Sourcepub fn awaited(&self) -> bool
pub fn awaited(&self) -> bool
Whether the walk is AWAITED — the OR law over the steps’ own words, AND the widening.
A WIDENING MAKES A WALK AWAITED WHATEVER ITS STEPS SAY. The expand seam’s call face is the
awaited AsyncQueryExpander, which is where a deployment’s own expander reaches a model; a
blocking one rides it through the lift bridge and the bridge runs one way, there being no
block_on in this framework. So the segment’s face is not an author’s word to choose, and this
is where the OR law reads it — the same law, one more term.
Sourcepub fn expand_at(&self) -> Option<usize>
pub fn expand_at(&self) -> Option<usize>
WHERE THE WIDENING OPENS, or None where this tower opens none.
One position and never a list: the grammar holds a tower to ONE segment of each kind, so the first is the only one.
Sourcepub fn annotate_at(&self) -> Option<usize>
pub fn annotate_at(&self) -> Option<usize>
⟂ WHERE THE ANNOTATION STAGE OPENS, or None where this tower opens none.
One position and never a list, for expand_at’s reason at the one word
whose second occurrence would be dead rather than merely unlawful: fill-if-absent means a
second stage over the same seat runs only where the first did not fill it, which is nowhere.
Sourcepub fn route_at(&self) -> Option<usize>
pub fn route_at(&self) -> Option<usize>
WHERE THE CROSSING OPENS, or None where this tower opens none.
Sourcepub fn fans(&self) -> impl Iterator<Item = (usize, &StepModel, &Fan)>
pub fn fans(&self) -> impl Iterator<Item = (usize, &StepModel, &Fan)>
EVERY FAN SEGMENT THIS TOWER OPENS, in declaration order — the position, and the fan.
The position is the step’s own index, which is the segment’s: a fan is a fact ABOUT a step, so there is one roster and the place a segment starts is where it sits in it.
Sourcepub fn fanned(&self) -> bool
pub fn fanned(&self) -> bool
Whether this tower FANS AT ALL — false for every tower written before the amendment, which is what makes those the degenerate case rather than a case.
Sourcepub fn step_options_name(&self) -> Ident
pub fn step_options_name(&self) -> Ident
The STEP-KEYED options object’s name — the declaration’s own, with StepOptions after it.
Derived rather than declared, for error_name’s reason and with the same
price: this is one of the names a tower mints in its declaring scope, so a tower beside an
author’s own <Tower>StepOptions is E0428 naming both.
The word STEP is load-bearing rather than decorative. There are two options objects now and
they are two CLOCKS — this one is keyed by step and named at INSTALL, and
search_options_name’s is keyed by the declaration’s own words and
named per REQUEST — so a bare <Tower>Options would have been the one name that could not say
which of them a reader was holding.
Sourcepub fn search_options_name(&self) -> Ident
pub fn search_options_name(&self) -> Ident
The WORD-KEYED options object’s name — the declaration’s own, with SearchOptions after it.
step_options_name’s twin at the other clock, minted under the same
collision rule and for the same reason.
Sourcepub fn weighted_crossing(&self) -> Option<(usize, &StepModel)>
pub fn weighted_crossing(&self) -> Option<(usize, &StepModel)>
WHETHER THIS DECLARATION’S ④ WORD NAMED THE SHIPPED WEIGHTED FAN — the one token that mints a lane-emphasis row.
TOKEN-KEYED and never type-resolved, which is the whole of why the row is mintable at all: a
bare word in route(router = …) is one of the routers this framework SHIPS, so the emitter
knows the type, its knob and its constructor. A QUOTED PATH is the declaring crate’s own router
and this answers None for it — not because such a router has no knobs but because nothing
here can know what they are, and a published field the emission could never spend is worse than
no field at all.
Sourcepub fn error_name(&self) -> Ident
pub fn error_name(&self) -> Ident
The refusal sum’s name — the declaration’s own, with Error after it.
Derived rather than declared, which is the assembled face’s rule one layer over: the
declaration’s name IS the vocabulary’s name, and a second word for it would be a name two
spellings could disagree about. Minted at the declaration’s own ident, so a tower beside an
author’s existing <Tower>Error collides where a reader can see both.