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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
//! Which INTERPRETATION a field's type is read under, and the map that picks one when a
//! declaration does not.
//!
//! A trait keyed on a TYPE answers once per type, which is right while a type has one meaning and
//! wrong the moment it has several. `Vec<u8>` is a byte string or a list of small integers;
//! `Vec<T>` is a sequence, where order and duplicates carry meaning, or a set, where neither does.
//! A registry row has to answer for the declarer, so it picks one and the other becomes
//! unspellable — and the set of collection types is OPEN (`Box<[u8]>`, a `SmallVec`, a downstream
//! crate's own), so enumerating the (collection × interpretation) pairs does not converge.
//!
//! # The interpretation is the CRATE's, and the map onto a filter is one AXIS's
//!
//! What a column MEANS — a number, a byte string, an unordered collection of a downstream crate's
//! own type — is a fact about the declaration, and every consumer of a declaration asks it. What
//! that meaning RESOLVES to is a fact about one binding: `ListMarker<Vec<Tag>>` becomes
//! [`ListFilter<Tag, …>`](crate::ListFilter) under the GraphQL axis, and a second wire binding would
//! answer the same marker with its own filter type through a map of its own, a SIBLING of
//! [`ToGraphqlFilter`](crate::ToGraphqlFilter) rather than a replacement for it.
//!
//! So the markers and the family traits are declared here and the ROWS that resolve them live with
//! the axis that owns their answer — `graphql::lower` carries every
//! `impl ToGraphqlFilter for …Marker<…>`, and the framework's two `Vec` rows with them, because what
//! those name is a filter type. The alternative was measured on the shape it produces rather than on
//! taste: with the markers under `graphql`, a second binding's map would reach the vocabulary it
//! answers over through the FIRST binding's module, so a build wanting only the second one would
//! still compile the first's name.
//!
//! One entanglement survives that split and is stated rather than hidden: [`DefaultMarker`] and
//! [`DefaultVecMarker`] carry [`ToGraphqlFilter`](crate::ToGraphqlFilter) as an item bound, and the
//! blanket over `Option<T>` restates it in a `where` clause. Dropping all three is what a module
//! naming nothing below it would cost, and the cost was MEASURED rather than argued: the crate still
//! compiles — the import goes unused and no other line moves — and the `compile_fail` example on
//! [`DefaultMarker`] then COMPILES. A `Reel` answering only the scalar family accepts
//! `type Marker = StringMarker<Reel>`, and the refusal that used to land on the registration lands
//! instead on the first projection that reaches its filter, at a call site the declarer did not
//! write. The bound is the refusal's ADDRESS, which is what the entanglement buys.
//!
//! # The shape
//!
//! [`ToGraphqlFilter`](crate::ToGraphqlFilter) is implemented for the MARKERS below and for nothing
//! else. Each has exactly one impl, and that impl does nothing but delegate to an INNER trait the
//! value type carries — one per position, and for a value one per FAMILY:
//!
//! ```
//! use ingraph::{
//! DefaultMarker, ListFilter, ListMarker, SetFilter, SetMarker, StringFilterMarker, StringMarker,
//! TextFilter, ToGraphqlFilter,
//! };
//!
//! // A type the DECLARING crate owns, in a `Vec` the framework never registered. Its own reading is
//! // the two rows below, and a collection of it needs them: the element questions a collection
//! // filter carries are asked in the ELEMENT's vocabulary.
//! struct Tag(String);
//!
//! impl StringFilterMarker for Tag {
//! type Filter = TextFilter<Tag>;
//! }
//!
//! impl DefaultMarker for Tag {
//! type Marker = StringMarker<Tag>;
//! }
//!
//! // One Rust type, two readings, distinguished by the marker rather than by a registry row.
//! let ordered: <ListMarker<Vec<Tag>> as ToGraphqlFilter>::Filter = ListFilter::new();
//! let unordered: <SetMarker<Vec<Tag>> as ToGraphqlFilter>::Filter = SetFilter::new();
//! # let _ = (ordered, unordered);
//! ```
//!
//! `ListMarker<Vec<Tag>>` and `SetMarker<Vec<Tag>>` are different self types, so the two outer
//! impls cannot overlap and coherence never has to reason negatively. **It is not specialization**:
//! the trait is split by POSITION, and a type answers once per position.
//!
//! Every marker here exists in TYPE position only: the field is private, so nothing outside this
//! crate can build one, and nothing inside does.
//!
//! # A family can REFUSE a marker
//!
//! The VALUE readings are one trait each — [`ScalarFilterMarker`], [`StringFilterMarker`],
//! [`BytesFilterMarker`], [`EnumFilterMarker`], [`BoolFilterMarker`], [`DurationFilterMarker`],
//! [`CompositeFilterMarker`] — rather than one trait answering for all seven.
//!
//! One trait makes every registered type answer every question. `i64` would satisfy the bound a
//! marker asserting *this column is read as a string* writes, and the answer would silently be its
//! scalar filter — a vocabulary in which nothing can be said wrongly says nothing. Split,
//! `StringMarker<i64>` is `E0277` at the site that wrote it:
//!
//! ```compile_fail
//! use ingraph::{StringMarker, ToGraphqlFilter};
//!
//! // `i64` is registered as a number and answers no other family, so it has no string reading for
//! // this projection to reach.
//! fn refused(_: <StringMarker<i64> as ToGraphqlFilter>::Filter) {}
//! ```
//!
//! The twin, so that what fails above is the refusal and not the spelling — the SAME projection
//! over the family `i64` does answer:
//!
//! ```
//! use ingraph::{ScalarFilter, ScalarMarker, ToGraphqlFilter};
//!
//! fn admitted(_: <ScalarMarker<i64> as ToGraphqlFilter>::Filter) {}
//!
//! admitted(ScalarFilter::<i64>::new());
//! ```
//!
//! It also stops a value reading from being at most one. A type may implement two of these traits
//! and mean both, exactly as it may implement [`ListFilterMarker`] and [`BytesFilterMarker`] and mean
//! both; they are different traits rather than two impls competing for one position.
//!
//! **No family trait carries a formula.** Each receives the type's own answer, because a family is
//! not one filter: `Vec<u8>` and `[u8; N]` are both bytes and their filters differ in the storage
//! shape they carry, so `type Filter = BytesFilter<Self>` would be a rule with an exception rather
//! than a rule.
//!
//! That the elements are a type this crate has never heard of is the second half of what the shape
//! buys. The framework's ONE `impl … for Vec<T>` covers every element, so the impl a declaring crate
//! could not write — `impl ToGraphqlFilter for Vec<Tag>` is `E0117` — is one it no longer needs.
//!
//! # The common case names no marker
//!
//! [`DefaultMarker`] maps a type to the marker it carries when nothing says otherwise, and it
//! is what an expansion projects through. A field whose type has one sensible reading — `String`,
//! `u64`, `Bytes` — is spelled in a declaration exactly as it was before this module existed.
//!
//! That map is a TYPE-level one rather than a rule the macro applies to the tokens it sees, and it
//! has to be: an emitter reads spellings, so `type Labels = Vec<String>` is indistinguishable from
//! a scalar there and a marker chosen syntactically would read an alias as the wrong
//! interpretation. Asking the type is what keeps an alias transparent.
//!
//! It also fixes where the INFERENCE's reading is chosen: per (type, position), not per field. Two
//! `Vec<Tag>` columns in one crate infer alike, because [`DefaultVecMarker`] is keyed on `Tag`. A
//! column that must differ from its neighbour says so in its DECLARATION —
//! `graphql(marker = set)` — which names the marker directly and asks this map nothing. A trait
//! impl cannot be overridden per field, so an override bypasses the map rather than feeding it: two
//! projection shapes, and the honest consequence is that a type with no row here is still filterable
//! wherever a declaration names its marker.
//!
//! # A composed marker carries the INNER marker, and the two halves have to agree
//!
//! [`ListMarker`], [`SetMarker`] and [`NullableMarker`] each take a second parameter naming how one
//! member is read. It is what makes *this `Vec<Vec<u8>>` is a list of lists* a spellable reading of
//! a type whose elements default to blobs, and it is the parameter `grost`'s own list marker carries
//! for the same reason.
//!
//! The parameter DEFAULTS to the inference, so nothing an expansion emits had to change: omitted, it
//! is the element's own [`DefaultMarker`], reached by asking [`State`](crate::State) what the
//! container holds. `ListMarker<Vec<Tag>>` is still the whole spelling and still resolves to what it
//! resolved to before the parameter existed.
//!
//! What the parameter costs is an agreement. `ListMarker<Vec<Tag>, ScalarMarker<u8>>` reads a list
//! of `Tag` as though the elements were `u8` — a reading of nothing — so the outer impls require the
//! container's projection and the inner marker's [`Marker::Marked`] to be the SAME type. The two
//! sides of that bound are the two traits below the marker layer: `State` answers for the container,
//! `Marker` for the marker.
//!
//! A DOWNSTREAM collection therefore joins with one impl more than before. `impl ListFilterMarker for
//! TheirVec<T>` says what the filter is; `impl State<Extracted<Inner>> for TheirVec<T>` says what
//! the elements are, and without it a composed marker over it cannot be checked — which is the
//! trade, stated rather than hidden: the second impl is what buys the first the ability to be
//! wrong.
use PhantomData;
use crate::;
/// Read a type as a NUMBER — one totally ordered value, which is what makes `gt` and its
/// neighbours mean something.
>);
/// Read a type as TEXT — one string of characters, which is what makes the substring and affix
/// questions mean something.
>);
/// Read a type as a BYTE STRING — one opaque run of bytes, searched as bytes and never as
/// characters.
>);
/// Read a type as an ENUMERATION — a closed vocabulary, so membership is the whole question and
/// there is no order to ask about.
>);
/// Read a type as a FLAGS SET — a closed vocabulary of BITS, so the questions are set-theoretic
/// and the stored value is the bit pattern behind them.
///
/// The enumeration's sister and never a special case of it: an enum column holds one of the names
/// and a flags column holds a subset, so `hasAll`/`hasAny`/`hasNone` are questions the enum kind
/// has no way to ask and equality is the only word the two share.
>);
/// Read a type as a BOOLEAN — two values, so an ordering operator would name every row or none.
>);
/// Read a type as a DURATION — an elapsed span, which carries a lexical form no number has.
>);
/// Read a type as a COMPOSITE — one value occupying SEVERAL columns of its holder's row, so the
/// questions are asked of its parts.
///
/// The reading a field fragment answers under, and the one every hand-written composite in this
/// ecosystem already reached by minting a marker of its own. It is the VALUE family's last member:
/// a composite's columns are its own, so both can be `NULL` together and the null state is a real
/// observable — which is why [`Marker::UnderOption`] answers [`NullableMarker`] here rather than the
/// collection reading.
///
/// # Why the family is a marker rather than a shape read off the type
///
/// Nothing about `Dimensions` tells a macro it spans two columns; the type answers that, through
/// [`ColumnKind`](crate::ColumnKind). The filter side needs the same answer at the same place, and a
/// marker is where this framework keeps *what reading is this column under* — so a composite joins
/// by the road every other family joins by, and a declaration naming `marker = …` and one naming
/// nothing resolve through one row.
>);
/// Read `T` as an ORDERED collection of elements read under `VM` — order and duplicates carry
/// meaning, so `[1, 2]` and `[2, 1]` are different operands.
///
/// # The second parameter, and the reading it makes spellable
///
/// A collection filter carries the filter ONE member is guarded by, because `any` asks a whole
/// element question and a question needs a vocabulary. `VM` is where that vocabulary is chosen, and
/// choosing it is what a `Vec<Vec<u8>>` column needs: its elements are blobs by default, and *this
/// one is a list of lists* is a different reading of the same Rust type.
///
/// # It DEFAULTS, and the default is why no emitted projection moved
///
/// Omitted, `VM` is the element's own [`DefaultMarker`] — reached by asking [`State`] what `T`
/// holds. So `ListMarker<Vec<Tag>>` stays a valid spelling and resolves to exactly what it resolved
/// to when the parameter did not exist, which is what keeps `graphql(marker = list)` a one-word
/// declaration and the emitter unchanged.
///
/// # The two halves must AGREE, and the bound is what says so
///
/// `ListMarker<Vec<Tag>, ScalarMarker<u8>>` reads a list of `Tag` as though its elements were `u8`.
/// It names no reading of anything, and it is refused — [`ToGraphqlFilter`](crate::ToGraphqlFilter)
/// asks `Vec<Tag>` what it holds and requires the inner marker to mark that:
///
/// ```compile_fail
/// use ingraph::{
/// EnumFilter, EnumFilterMarker, ListMarker, ScalarMarker, ToGraphqlFilter,
/// };
///
/// struct Tag;
///
/// impl EnumFilterMarker for Tag {
/// type Filter = EnumFilter<Tag>;
/// }
///
/// // The halves disagree: the collection holds `Tag` and the inner marker marks `u8`.
/// fn refused(_: <ListMarker<Vec<Tag>, ScalarMarker<u8>> as ToGraphqlFilter>::Filter) {}
/// ```
///
/// The twin, so that what fails above is the disagreement and not the spelling — the SAME projection
/// with the halves agreeing does resolve:
///
/// ```
/// use ingraph::{EnumFilter, EnumFilterMarker, EnumMarker, ListMarker, ToGraphqlFilter};
///
/// struct Tag;
///
/// impl EnumFilterMarker for Tag {
/// type Filter = EnumFilter<Tag>;
/// }
///
/// fn admitted(_: <ListMarker<Vec<Tag>, EnumMarker<Tag>> as ToGraphqlFilter>::Filter) {}
/// ```
///
/// What the refusal buys is that the mismatch is caught where it is WRITTEN. Without it the two
/// halves would meet at the filter type — `ListFilter<Tag, ScalarFilter<u8>>` is a type that
/// compiles — and the column would render an `any` whose operators asked about a `u8` that is not
/// in it.
>,
);
/// Read `T` as an UNORDERED collection of elements read under `VM` — neither order nor duplicates
/// carry meaning, so whole collection equality is mutual containment.
///
/// `VM` is [`ListMarker`]'s, in every respect: the same default, the same agreement bound, the same
/// refusal. See it.
>,
);
/// Read `T` as a collection whose ELEMENTS ARE ASKED ABOUT ONE AT A TIME and never as operands —
/// [`QuantifiedFilter`](crate::QuantifiedFilter)'s reading, whose whole vocabulary is *some element
/// satisfies this* and *this collection holds this many*.
///
/// # It is not a narrower [`ListMarker`], and the axis is the ELEMENT rather than the order
///
/// [`ListMarker`] and [`SetMarker`] disagree about what the COLUMN's order means. This one agrees
/// with both and disagrees about the ELEMENT: whether it has a literal form worth putting on the
/// wire. A collection of `(code, score)` detections is stored in whatever order the writer produced,
/// so the ordered reading is true of it — and every operator that reading would publish takes a
/// detection LITERAL, which a float-bearing pair has no honest one of. See
/// [`QuantifiedFilter`](crate::QuantifiedFilter), where the departing operators are named one by one.
///
/// So the three collection readings are not a chain from wide to narrow. Each is a fact about a
/// different thing, and a column that is unordered AND element-opaque takes this one: the operators a
/// set adds over a sequence are exactly the ones whose operands are collections of elements, so there
/// is nothing left for a fourth marker to name.
///
/// # `VM` is [`ListMarker`]'s, and it is what carries the element's OWN vocabulary
///
/// The same default, the same agreement bound, the same refusal — see [`ListMarker`]. It matters
/// more here than there: `any` is one of two operators rather than one of nine, so the element's own
/// filter is where practically every question a caller can ask about this column lives.
///
/// # How a declaration REACHES it
///
/// Two roads, and neither is new machinery. A `Vec<Detection>` column takes this reading by DEFAULT
/// once `Detection` says so — `impl DefaultVecMarker for Detection { type Marker =
/// QuantifiedMarker<Vec<Detection>>; }`, which is the same one-line row a downstream writes to say
/// its `Vec` is a set. A column that must differ from what its type infers names the marker itself.
>);
/// Read `T` as a NULLABLE column whose value is read under `VM` — `VM`'s operators, plus the null
/// test.
///
/// # It names the OPTIONAL type where it used to name only the inner marker
///
/// `NullableMarker<StringMarker<Reel>>` said *a null test over the string reading of `Reel`* and
/// said nothing about which type was optional — so it was equally spellable over a `Reel` that could
/// not be null. The type is named now, and the same bound the collections carry ties the two halves
/// together: `T` holds what `VM` marks.
///
/// `VM` defaults exactly as [`ListMarker`]'s does, so `NullableMarker<Option<Reel>>` is the whole
/// spelling and the inference reaches it with nothing named.
///
/// The agreement is pinned here as well as at [`ListMarker`], because this impl states the bound
/// itself rather than inheriting one — the two could rot apart:
///
/// ```compile_fail
/// use ingraph::{NullableMarker, ScalarMarker, StringMarker, TextFilter, ToGraphqlFilter};
///
/// struct Reel;
///
/// impl ingraph::StringFilterMarker for Reel {
/// type Filter = TextFilter<Reel>;
/// }
///
/// // The halves disagree: the optional column holds `Reel` and the inner marker marks `u8`.
/// fn refused(_: <NullableMarker<Option<Reel>, ScalarMarker<u8>> as ToGraphqlFilter>::Filter) {}
/// # let _ = refused;
/// ```
///
/// …and its twin, agreeing:
///
/// ```
/// use ingraph::{NullableMarker, StringMarker, TextFilter, ToGraphqlFilter};
///
/// struct Reel;
///
/// impl ingraph::StringFilterMarker for Reel {
/// type Filter = TextFilter<Reel>;
/// }
///
/// fn admitted(_: <NullableMarker<Option<Reel>, StringMarker<Reel>> as ToGraphqlFilter>::Filter) {}
/// ```
///
/// # No delegation trait under it, where the collections have one
///
/// [`ListFilterMarker`] exists because what a sequence's filter IS varies with the container: `Vec<T>`
/// answers `ListFilter<T, _>` and a downstream collection may answer something else. Nullability has
/// no such variation — [`Nullable<F>`](crate::Nullable) is this crate's own single wrapper and the
/// only answer there is — so the filter is computed at the row rather than asked for. A downstream
/// `MyOption` still joins, by writing the [`State`] row that says what it holds; it needs nothing
/// else.
>,
);
/// Read `T` as whatever `VM` reads what `T` holds as — the `Option` is TRANSPARENT here rather than
/// a state the filter carries.
///
/// # What it is for
///
/// A COLLECTION has no null state. An edge table holds one observable for a column holding nothing —
/// no rows — where `Option<Vec<T>>` spells two, `None` beside `Some(<empty>)`; a distinction no
/// storage can keep must not be spellable as though it could. So an `Option` around a collection
/// declares the COLLECTION, and this is the marker that says so: `OptionalMarker<Option<Vec<Tag>>,
/// ListMarker<Vec<Tag>>>` is the sequence reading of a type whose Rust spelling is optional, and its
/// filter carries no null test for a backend to render against a table that has no such column.
///
/// [`Marker::UnderOption`] is what reaches it without a declaration naming it, and the family is
/// what decides — see that trait for the two stock answers.
///
/// # Named for what it MARKS, which is the family's law and is load-bearing here
///
/// [`ScalarMarker`] marks a scalar, [`ListMarker`] a list, [`EnumMarker`] an enumeration — and this
/// one marks an OPTIONAL. Naming it for what the reading DOES to the `Option` would put it in
/// collision with the one other place this crate spends that vocabulary: a composed filter's
/// `#[ingraph(flatten)]` splices a component's fields INTO its host, which is the opposite
/// operation. One word for both would be one word for *this wrapper says nothing* and *fold these
/// fields in*.
///
/// # `VM` defaults, exactly as [`ListMarker`]'s does
///
/// Omitted, it is the inner type's own [`DefaultMarker`], reached by asking [`State`] what `T`
/// holds. So `OptionalMarker<Option<Vec<Tag>>>` is a whole spelling and resolves through the
/// collection's own inference.
///
/// # The two halves must AGREE
///
/// The same bound the other composed markers carry: `T` holds what `VM` marks, so an optional
/// reading whose inner marker reads something the type does not hold is refused where it is written.
///
/// ```compile_fail
/// use ingraph::{OptionalMarker, ScalarMarker, ToGraphqlFilter};
///
/// // The halves disagree: the optional column holds `Vec<String>` and the inner marker marks `u8`.
/// fn refused(
/// _: <OptionalMarker<Option<Vec<String>>, ScalarMarker<u8>> as ToGraphqlFilter>::Filter,
/// ) {
/// }
/// ```
///
/// …and its twin, agreeing:
///
/// ```
/// use ingraph::{ListFilter, ListMarker, OptionalMarker, TextFilter, ToGraphqlFilter};
///
/// fn admitted(
/// _: <OptionalMarker<Option<Vec<String>>, ListMarker<Vec<String>>> as ToGraphqlFilter>::Filter,
/// ) {
/// }
///
/// admitted(ListFilter::<String, TextFilter<String>>::new());
/// ```
///
/// # The delegation is TOTAL, where `grost`'s gives the outer type a vote
///
/// `grost` has this marker and this shape — it spells it `FlattenMarker` — and resolves it by
/// delegation too, but its outer type keeps a say, because the wire layer it resolves into needs a
/// presence bit and `T` is what carries one. A QUERY face has nothing of the kind: the filter here
/// IS the inner marker's filter, with nothing of `T` in it, which is the whole of what *the `Option`
/// is transparent* means.
>,
);
/// What a marker MARKS — the type it is an interpretation OF.
///
/// Every marker below answers, and the answer is the type in its first parameter. That looks like
/// restating the parameter and is not: a marker is reached through a projection, where the parameter
/// is no longer written down, so the only way to ask *what is this an interpretation of* is to ask
/// the marker.
///
/// # What asking buys
///
/// A composed marker holds another marker — `ListMarker<Vec<Tag>, EnumMarker<Tag>>` — and the two
/// halves have to agree or the type names a reading of nothing. The agreement is checkable exactly
/// because both halves can be asked: the collection says what it holds through
/// [`State`](crate::State), the inner marker says what it marks through here, and the bound is that
/// the two are the same type. See [`ListMarker`] for the refusal that follows.
///
/// # NOT sealed, where `grost`'s is
///
/// A declaration may name a marker the DECLARING crate owns — `graphql(marker = "their::RollMarker")`
/// — and such a marker is as much an interpretation as the ones here. Sealing would make it one this
/// trait could not describe, so a downstream marker could never be the inner half of a composed one:
/// `ListMarker<TheirVec<X>, their::RollMarker<X>>` would be unspellable for no reason but the seal.
///
/// The seal would also buy nothing here. `grost` seals because its marker set is a WIRE vocabulary —
/// a marker there decides an encoding, and an encoding nobody else can add is the point. A marker
/// here decides which Rust filter type a column gets, and a filter type is already a thing a
/// downstream declares.
/// What guards a column whose type is read as a NUMBER.
///
/// A type answering here says only what a SCALAR column of it is filtered by. Whether it also
/// answers another family, or a collection position, is that trait's business and not this one's.
/// What guards a column whose type is read as TEXT.
/// What guards a column whose type is read as a BYTE STRING.
///
/// Two of this crate's own rows are why the trait states its answer rather than computing one:
/// `Vec<u8>` takes `BytesFilter<Vec<u8>>` and `[u8; N]` takes `BytesFilter<[u8; N], Fixed<N>>`, one
/// family with two filters, so the storage shape is the TYPE's to name.
/// What guards a column whose type is read as an ENUMERATION.
/// What guards a column whose type is read as a FLAGS SET.
/// What guards a column whose type is read as a BOOLEAN.
/// What guards a column whose type is read as a DURATION.
/// What guards a column whose type is read as a COMPOSITE.
///
/// The type states its own filter for the reason [`BytesFilterMarker`] does: what a composite's
/// filter LOOKS like is a fact about that composite's parts, and no projection over the type can
/// compute it. A field fragment's expansion writes this row naming the filter it emitted beside it;
/// a hand-written composite writes it naming the one its author wrote.
///
/// # TWO filters, because a composite is the one reading whose truth depends on its host
///
/// *Each face tells its own truth* — the 2026-08-22 ruling. A fragment held by a ROW-HOLDING host
/// can be compared only by what it is stored in: a field the declaration took out of the row with
/// `record(skip)` has no query-time value but a raise's fill, and filtering a constant is a lying
/// schema. A fragment held by a ROWLESS host has no such subset — memory is the data — so every
/// field it declares is askable.
///
/// So the two rows name the two predicates. A declaration activated for one host kind emits ONE
/// type and names it at both seats, which is the common case and costs nothing; one activated for
/// both emits two, and the seats part. A hand-written composite that mounts one predicate for both
/// worlds writes the same type twice, and that is the honest statement of what it means.
/// What guards a column whose type is read as an ORDERED collection.
///
/// The associated type is GENERIC over the element's filter, because a collection filter carries
/// one: `any` asks a whole element question, and which vocabulary it is asked in is the MARKER's
/// choice rather than the container's. The container decides the rest — `Vec<T>` answers
/// `ListFilter<T, VF>` and a downstream collection may answer its own type — which is why the
/// question is delegated here at all instead of being computed at the marker.
/// What guards a column whose type is read as an UNORDERED collection.
///
/// `VF` is [`ListFilterMarker`]'s, for the same reason. See it.
/// What guards a column whose type is read as a collection asked ONLY through quantifiers.
///
/// `VF` is [`ListFilterMarker`]'s, for the same reason — the container decides what the filter IS,
/// and the element's vocabulary arrives as a parameter. A family of its own rather than a flag on
/// the sequence one, for the reason every family here is separate: what a marker decides is an
/// operator SET, and a container may well answer this position and the ordered one both.
// What each marker marks, and what an `Option` of it is read as. Unconditional, and deliberately so:
// what a marker is an interpretation OF is a fact about the marker's own shape, settled the moment
// the type is written. Whether that interpretation RESOLVES to a filter is [`ToGraphqlFilter`]'s
// question and carries the family bound there, so a marker over a type answering nothing still
// answers this one — which is what lets a coherence bound name the marked type before knowing the
// reading is satisfiable.
//
// The six VALUE families take the null test, because a plain column's two states are both real and
// both observable. The two COLLECTION families read the `Option` transparently instead — see
// [`Marker::UnderOption`] for the ruling, which is a fact about the FAMILY and is therefore stated
// here rather than at the blanket that reads it.
/// The VALUE family's answer, and the note on [`Marker::UnderOption`] names this kind in as many
/// words: a composite occupies columns OF ITS OWN, so all of them are `NULL` together and the
/// `isNull` question distinguishes two real states.
// The third COLLECTION family, and its `Option` is transparent exactly as the other two families'
// is: what makes a collection's null unspellable is the STORAGE — an edge table holds one observable
// for a column holding nothing — and that is true of a collection whichever operators its filter
// publishes.
// The two composed readings answer in their OWN lane: a further `Option` around either changes no
// family, so a null test stays a null test and an optional reading stays optional.
/// The marker a field's type carries when the declaration names none.
///
/// This is the INFERENCE, and it is what keeps the common case free of annotation: an expansion
/// projects a domain type through here, so a field whose type has one sensible reading is declared
/// exactly as it was before markers existed.
///
/// The associated type carries [`ToGraphqlFilter`](crate::ToGraphqlFilter) as an item bound so that
/// a registration naming a marker nothing answers for fails AT the registration, rather than at the
/// first declaration that happens to use the type. It is also the one place this module names the
/// GraphQL axis — see the module note, where dropping the bound is measured: the crate still
/// compiles and the `compile_fail` example below stops failing.
///
/// It carries `Marker<Marked = Self>` beside it, which is a LAW and not only a bound: the marker a
/// type defaults to must be an interpretation OF THAT TYPE. Nothing said so before, and
/// `type Marker = ScalarMarker<SomethingElse>` was a well-formed row.
///
/// Saying it is what makes a composed marker's default checkable. `NullableMarker<Option<T>>`
/// resolves its inner half to `<T as DefaultMarker>::Marker` and then has to prove that half marks
/// `T` — which for an abstract `T` is provable only from the item bound. Without it the equality is
/// an opaque projection and the blanket over `Option<T>` is `E0271`, measured on the way in.
///
/// That is what keeps the two halves of a registration from drifting. `type Marker =
/// StringMarker<Reel>` is well formed only while `Reel: StringFilterMarker`, so a row whose family
/// impl says one thing and whose default says another is `E0277` on the line that wrote it —
/// measured, and pinned by the `compile_fail` example below.
///
/// ```compile_fail
/// struct Reel;
///
/// impl ingraph::ScalarFilterMarker for Reel {
/// type Filter = ingraph::ScalarFilter<Reel>;
/// }
///
/// // The halves disagree: `Reel` answers the scalar family and the default names the string one.
/// impl ingraph::DefaultMarker for Reel {
/// type Marker = ingraph::StringMarker<Reel>;
/// }
/// ```
/// An `Option` is read as whatever the interpretation under it says an `Option` of it is read as —
/// one blanket over every `T`, asking [`Marker::UnderOption`] rather than naming a wrapper.
///
/// The FAMILY is what answers, so `Option<String>` is a nullable text column and `Option<Vec<Tag>>`
/// is a list. Naming [`NullableMarker`] here made the second one a `Nullable<ListFilter<…>>`, whose
/// null test lowers to `IS NULL` against the table the record is kept in — which has no such column,
/// a collection being kept beside it. The ruling is [`Marker::UnderOption`]'s; this row is where it
/// is read, which is what makes a declaration naming `marker = list` and one naming nothing agree by
/// construction.
///
/// One impl where the registry carried two rows per registered type (`Option<T>` and
/// `Option<Vec<T>>`), and it reaches every type the map does — a downstream's own included, which
/// `impl DefaultMarker for Option<TheirType>` cannot (`E0117`).
///
/// # The bound is HERE and not on [`Marker::UnderOption`]
///
/// This trait requires its answer to resolve to a filter, and [`Marker`] promises no such thing on
/// purpose: it is unconditional, so a marker over a type answering no family still says what it
/// marks. An item bound of [`ToGraphqlFilter`](crate::ToGraphqlFilter) there would put each family's
/// own bound on each of those impls and take that away. Stated here it costs nothing at a concrete
/// type, which is what an expansion projects.
/// What a [`Vec`] of this ELEMENT type means when a declaration names no marker.
///
/// The delegation half of the pattern, with no marker of its own: there is one position — what a
/// `Vec<T>` defaults to — and the thing that decides it is `T`, so a row per element type is the
/// whole answer.
///
/// It is what lets a DOWNSTREAM element type join. `impl DefaultMarker for Vec<TheirType>` is
/// `E0117`; `impl DefaultVecMarker for TheirType` names a local type and is legal, and it is also
/// where such a crate says its `Vec<Tag>` columns are SETS. A downstream COLLECTION needs neither —
/// `TheirVec<T>` is local, so it implements [`DefaultMarker`] directly.
///
/// A row per element rather than one blanket, because the answer is not uniform and cannot be made
/// so: `Vec<u8>` is a blob and every other `Vec<T>` is a list, and a blanket beside an exception for
/// one element type is `E0119` on stable — which is the same wall that put the marker layer above
/// this one.
// `Sized` because the bound below names `Vec<Self>`, and a `Vec` element is sized. It is a
// restatement rather than a restriction: every implementer already had to be, or the `Vec` this
// trait is about could not exist.