1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Built-in support for the `FindMany<Model>` procedure-argument type
//! (`.cstack` syntax) — search-with-filters for procedures. Composes
//! with `PageInput` rather than absorbing it — a procedure wanting both
//! filtering and pagination declares two arguments, e.g. `procedure
//! search(query: FindMany<Post>, page: PageInput): Page<Post>`.
//!
//! This module holds only the one piece that's genuinely shared across
//! every model: the per-field operator envelope. Everything else — which
//! fields a model has, which operators apply to which field — is
//! per-model and lives in `cratestack-macros`-generated code
//! (`<Model>Where`, `<Model>SortField`, `<Model>OrderByClause`,
//! `<Model>FindManyInput`), mirroring how `Create<Model>Input`/
//! `Update<Model>Input` are per-model generated structs rather than one
//! shared generic wrapper.
use ;
/// Every operator a filterable field might support, as one flat
/// optional-per-operator envelope — generated per-model code reads only
/// the operators that make sense for a given field's type (e.g. a
/// `Boolean` field's generated `to_filters()` never looks at `contains`).
/// `V` is the field's own scalar Rust type (`String`, `i64`, `bool`,
/// `chrono::DateTime<Utc>`, ...) — never `Option<V>` even for an optional
/// field, since these operators describe a *value to compare against*,
/// not the field's own nullability (which `is_null` covers instead).
///
/// Deliberately not full parity with every `FieldRef` method:
/// `isTrue`/`isFalse` are omitted (redundant with `eq: true`/`eq: false`
/// once callers have a real JSON boolean) and `eqOrNull` is omitted (a
/// Rust-ergonomics convenience over `eq` + `isNull`, not new capability).