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
//! [`FusionOptions`] — the per-tier ALGORITHM knob, and the wire shape a new fusion flavour arrives
//! as.
use Fusion;
/// WHICH fold a tier runs, and the numbers that fold takes — the wire and configuration face of
/// [`Fusion`].
///
/// # It is a `@oneOf` and not a struct of optional blocks, and the difference is a schema fact
///
/// A tier runs ONE fold. A struct carrying `rrf: Option<…>` beside a future `bordaCount: Option<…>`
/// would let a client name both, and the type would then have to refuse at run time what the schema
/// had already accepted. `@oneOf` moves that refusal into the parse: exactly one non-null member, or
/// the request never reaches this crate. It is the shape the order-by face already takes, for the
/// same reason and by the same mechanism.
///
/// # Why it is not [`Fusion`] itself
///
/// [`Fusion`] is the FOLD — a value the fold reads, with every parameter resolved. This is the
/// REQUEST, where every parameter is still optional because a client that names the flavour and
/// nothing else means *that flavour, at the ruled constants*. The two are one
/// [`fusion`](Self::fusion) call apart, and keeping them apart is what lets `Fusion::RRF_K` stay a
/// law rather than becoming a value every client has to restate.
///
/// # One variant today, and the shape is what makes the second one cheap
///
/// [`Fusion`]'s own argument, inherited whole: a second flavour is one variant here, one arm in
/// [`fusion`](Self::fusion), and one more member of the `@oneOf` on the wire — additive at every
/// site, with no client's existing document changed.
/// The fold a tier runs when its options say nothing.
/// RECIPROCAL RANK FUSION's own parameters — one number, and it is optional.
///
/// # `k` is [`Option`] here and bare in [`Fusion`], and that is the de-Option law rather than a
/// mismatch
///
/// Absence here DEFERS: a client that wrote `{ rrf: {} }` asked for reciprocal rank fusion at
/// whatever this framework's ruling says, and [`Fusion::RRF_K`] is what answers. A resolved
/// [`Fusion`] has no chain left to defer to, so its `k` is a number. The two spellings are the two
/// ends of one resolution, and collapsing them would either put a default in a law's place or make
/// every client restate the law.