Skip to main content

TowerModel

Struct TowerModel 

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

The path to the ingraph crate itself — ::ingraph unless #[ingraph(crate = "…")] named another.

§name: Ident

The declared type — what the connectivity is stated over and what the walk is minted on.

§vis: Visibility

The 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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn route_at(&self) -> Option<usize>

WHERE THE CROSSING OPENS, or None where this tower opens none.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for TowerModel

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 Debug for TowerModel

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.