pub struct StandaloneModel {
pub vis: Visibility,
pub subject: Ident,
pub krate: Path,
pub filter: RustSafeName,
pub order_by: RustSafeName,
pub comparison: RustSafeName,
pub databases: Vec<DatabaseKind>,
pub columns: Vec<StandaloneColumn>,
pub hook: Option<Path>,
}Expand description
A hand-written struct, as the three bare doors read it.
PLAIN, for RecordModel’s reason — public fields, no constructor,
no validation. What is checked is checked at the FRONT END, where the tokens an author wrote are
still in hand and a refusal can point at one.
Fields§
§vis: VisibilityThe declaration’s own visibility, which every emitted item takes.
subject: IdentThe struct the faces are OF — the doc sentences’ noun, and the type a crossing compares.
krate: PathThe ingraph root the expansion spells its shelf through.
filter: RustSafeNameWhat the FILTER face is called.
order_by: RustSafeNameWhat the ORDER-BY face is called.
comparison: RustSafeNameWhat ONE comparison is called before the per-database suffix is applied — the base a record spells as its row’s name.
databases: Vec<DatabaseKind>The databases the comparison is emitted for. EMPTY is one comparison generic in its dialect.
columns: Vec<StandaloneColumn>The columns, in declared order.
hook: Option<Path>#[ingraph(filter = "path")] — the filter seat a crossing is emitted FROM.
Implementations§
Source§impl StandaloneModel
impl StandaloneModel
Sourcepub fn emit_filter(&self) -> TokenStream
pub fn emit_filter(&self) -> TokenStream
The FILTER face: the where-struct and its builders, over the WIRE form of every column.
Sourcepub fn emit_order_by(&self) -> TokenStream
pub fn emit_order_by(&self) -> TokenStream
The ORDER-BY face: the term enum, its direction, its identity and its subject path.
All four, where a record gates two of them. A record’s identity rides the PAGE’s own law —
it needs a stored id and a SQL clause machine — and neither is a fact a hand-written struct
has: what is being ordered here is the struct’s own fields, and every term of it names one.
Sourcepub fn emit_comparison(&self) -> TokenStream
pub fn emit_comparison(&self) -> TokenStream
The COMPARISON face: one per named database, or ONE generic in its dialect where none is named.
§BOTH branches gain the value-level pair, through the SAME call
generic_pair is called from HERE, beside one_comparison’s own call
in both branches and never inside it — so one_comparison itself runs the exact code it
always has, unreached by the new method’s own body regardless of which branch a declaration
takes. That is what makes byte-identity a fact about which LINES a declaration reaches rather
than something asserted about a shared body: nothing this knife added is inside
one_comparison, so everything IT emits — the struct, the accessors, the lowering, the map
row — stays what it was, in both branches, and the only new tokens either branch can gain are
generic_pair’s own, called with that branch’s own at.