Skip to main content

LoweringColumn

Struct LoweringColumn 

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

The Rust member — layer 1, which no word moves.

§rendered: String

The 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: bool

Whether 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: TokenStream

The 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

Source

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.

Source

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.

Source

pub fn with_gate(self, gate: TokenStream) -> Self

The same row, carrying the CONDITION its column is declared under.

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> 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, 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.