Skip to main content

comparison

Function comparison 

Source
pub fn comparison(
    header: &UnitHeader<'_>,
    database: &Ident,
    crossings: &TokenStream,
    columns: &[ComparisonColumn],
) -> (TokenStream, TokenStream)
Expand description

The COMPARISON face: a struct holding one crossed comparison per column, over a database parameter, under the where clause its field types are well formed by.

§The empty case gets a PhantomData, and only it

With no column the database parameter occurs nowhere in the struct and E0392 would land inside an expansion its author cannot edit. Nothing can collide with the name, because a collision would have to be with a column and there are none.

§The where clause is the CALLER’s

What a comparison assumes is one list — that the database is a Backend at all, and that each column’s filter crosses into something for it — and the struct’s clause is the whole of what makes its field types well formed. The unit takes it rather than building it because the refinement a flatten column states is a fact about the COLUMN’s storage, which is a grammar word’s business and not this walk’s. An impl asserting anything MORE would report a missing crossing twice; one asserting less would not apply to the type it is written for — so the clause is spliced verbatim into both.