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
// src/core/state_diagnostics.rs
// Diagnostic traits for improved compile-time error messages when operations
// are called on incompatible query states.
use crate;
/// Implemented by query states that support `select` (projection).
///
/// Only [`Filtered`] implements this trait, so calling `select` on an
/// [`Initial`] or [`Sorted`] query produces a clear error message referencing
/// this trait rather than a generic type mismatch.
/// Implemented by query states that support `then_by` / `then_by_descending`.
///
/// Only [`Sorted`] implements this trait.
/// Implemented by query states that support `order_by` / `order_by_descending`.
///
/// Both [`Initial`] and [`Filtered`] implement this trait.
/// Bound for element types that support set operations (`distinct`, `union`,
/// `intersect`, `except`).
///
/// Any type that implements both [`std::hash::Hash`] and [`Eq`] automatically
/// implements `HashEqBound`. If your type does not implement one of these, the
/// compiler error will reference `HashEqBound` and point directly to the
/// missing derive.
/// Internal macro for defining a sealed state-constraint trait with a single
/// blanket implementation.
///
/// Usage:
/// ```ignore
/// define_state_constraint!(MyConstraint, StateA, StateB);
/// ```
/// expands to a `pub trait MyConstraint {}` plus `impl MyConstraint for StateA {}`
/// and `impl MyConstraint for StateB {}`.