Skip to main content

filter

Function filter 

Source
pub fn filter(
    header: &UnitHeader<'_>,
    columns: &[FilterColumn],
) -> (TokenStream, TokenStream)
Expand description

The FILTER face: a struct with one optional filter per column, and the builder pair per member.

§Each field carries its type’s FILTER, never its value

Option<value> expresses equality ALONE, and on a nullable column it collapses three states — no predicate, IS NULL, = v — into two, making a null match inexpressible. The framework carries the null test on a Nullable<F> wrapper and registers Option<T> to it, where a bare T gets the plain filter, so nullability needs no detection here — and must get NONE: the domain type is written verbatim, and normalising an Option away would hand a nullable column the filter of a NOT NULL one, where IS NULL does not exist.

§with_* names the builder step

The argument is a filter rather than a value: its TYPE is the filter’s and its ROLE is the builder’s — it is what the field takes in the value being built. filter_* would read as APPLYING a filter rather than setting one, and every emitted key already spells this shape with_*.