Skip to main content

alux_http/
with.rs

1/// Describes type-level accumulation of one more input in a declaration's product.
2///
3/// Each recorded input role extends the endpoint's extractor product and its handler argument
4/// product in the same position, so declaration order is the application order.
5pub trait WithAlg {
6    /// The product formed by appending `Input` to this product.
7    type With<Input>;
8}
9
10impl WithAlg for () {
11    type With<Input> = (Input,);
12}
13
14impl<A0> WithAlg for (A0,) {
15    type With<Input> = (A0, Input);
16}
17
18impl<A0, B0> WithAlg for (A0, B0) {
19    type With<Input> = (A0, B0, Input);
20}
21
22impl<A0, B0, C0> WithAlg for (A0, B0, C0) {
23    type With<Input> = (A0, B0, C0, Input);
24}
25
26impl<A0, B0, C0, D0> WithAlg for (A0, B0, C0, D0) {
27    type With<Input> = (A0, B0, C0, D0, Input);
28}
29
30impl<A0, B0, C0, D0, E0> WithAlg for (A0, B0, C0, D0, E0) {
31    type With<Input> = (A0, B0, C0, D0, E0, Input);
32}
33
34impl<A0, B0, C0, D0, E0, F0> WithAlg for (A0, B0, C0, D0, E0, F0) {
35    type With<Input> = (A0, B0, C0, D0, E0, F0, Input);
36}
37
38impl<A0, B0, C0, D0, E0, F0, G0> WithAlg for (A0, B0, C0, D0, E0, F0, G0) {
39    type With<Input> = (A0, B0, C0, D0, E0, F0, G0, Input);
40}