pub struct LoweringColumn {
pub member: Ident,
pub rendered: String,
pub flatten: bool,
pub through: Option<TokenStream>,
pub gate: TokenStream,
}Expand description
One column, as the comparison’s LOWERING reads it.
Fields§
§member: IdentThe Rust member — layer 1, which no word moves.
rendered: StringThe name this database RENDERS the column under — layer 3, which a per-database rename moves.
Empty where no frame is pushed, which is the one state that has no rendered name to carry: see
flatten.
flatten: boolWhether this member is applied at the holder’s OWN address rather than one segment below it.
Two declarations reach it and their reasons are different. A flatten COLUMN lends no name, so
its type’s columns join the holder’s namespace. A REVERSE RELATION position names no column of
this row at all — only the child’s foreign key and this row’s id, both known without it — so
the address it is handed goes unread and a frame below it would be a segment nothing renders.
One flag rather than two, because what the emission does with it is one thing: not pushing a
frame. unframed is the second reason’s own door, so a reader of a call site
sees which of the two it is.
through: Option<TokenStream>The qualified path this member’s lowering is reached through — None for the
ComplexComparison<Db> every column takes.
A RELATION member takes the other door, and the reason is the wall its own crossing note
records: its type is a projection through ToRelatedComparison, and a where clause saying
that projection lowers resolves through the impl that defines it, demanding of a generic Db
what only a concrete one can give. ToLoweredRelatedComparison carries the rendering as
METHODS over the FILTER, so the call names no projection and the clause names no dialect.
A TokenStream rather than a flag, because the path carries the position’s own far side —
<RelatedFilter<…> as ToLoweredRelatedComparison<…, DB>> — which only the caller knows.
gate: TokenStreamThe CONDITION the column is declared under, as the attribute to prefix onto every artifact it mints here — empty for a column that wrote none, and for every unit whose front end has no condition seat.
Carried on the ROW rather than looked up, because a unit is shared: the record family knows a
field’s #[cfg] and the interface and standalone families have no such word, so the fact
arrives with the column exactly as its filter and its noun do. See
Condition.
Implementations§
Source§impl LoweringColumn
impl LoweringColumn
Sourcepub fn unframed(member: Ident, through: TokenStream) -> Self
pub fn unframed(member: Ident, through: TokenStream) -> Self
A member applied at the address it is handed, under no name of its own — what a REVERSE RELATION position is.
Sourcepub fn framed(
member: Ident,
rendered: String,
through: Option<TokenStream>,
) -> Self
pub fn framed( member: Ident, rendered: String, through: Option<TokenStream>, ) -> Self
A member applied one segment below the address, under the name rendered — an ordinary COLUMN,
or a forward relation position, which renders at the FOREIGN KEY’s own address.
Sourcepub fn with_gate(self, gate: TokenStream) -> Self
pub fn with_gate(self, gate: TokenStream) -> Self
The same row, carrying the CONDITION its column is declared under.