Skip to main content

StandaloneModel

Struct StandaloneModel 

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

The declaration’s own visibility, which every emitted item takes.

§subject: Ident

The struct the faces are OF — the doc sentences’ noun, and the type a crossing compares.

§krate: Path

The ingraph root the expansion spells its shelf through.

§filter: RustSafeName

What the FILTER face is called.

§order_by: RustSafeName

What the ORDER-BY face is called.

§comparison: RustSafeName

What 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

Source

pub fn emit_filter(&self) -> TokenStream

The FILTER face: the where-struct and its builders, over the WIRE form of every column.

Source

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.

Source

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.

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.