Rindle docs and package mapSkip to main content

canon_of_lit

Function canon_of_lit 

Source
pub fn canon_of_lit(lit: &Lit) -> Option<CanonVal>
Expand description

The binding-value class of a scalar literal (design 310 §3.1 / impl plan §3.2): Some iff lit is a scalar a parameterized query family may bind on — Bool/Int/ Str directly, Number through the same number coercion the predicate lowering applies (lit_to_scalarnumber_to_owned) and then CanonVal::of, so Int(1) and Number(1.0) are one binding exactly when values_equal says so, and a binding agrees cell-for-cell with the col = lit predicate it stands in for. Null (SQL never-match — the predicate folds it to false), Array (an IN list), and a non-finite Number (no wire token; [canonicalize_wire_number_lits] folds it to Null) are None — ineligible.