grafbase-hooks 0.4.1

An SDK to implement hooks for the Grafbase Gateway
Documentation
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
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
/// Error thrown when accessing the headers. Headers names or values
/// must not contain any special characters.
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum HeaderError {
    /// the given header value is not valid
    InvalidHeaderValue,
    /// the given header name is not valid
    InvalidHeaderName,
}
impl HeaderError {
    pub fn name(&self) -> &'static str {
        match self {
            HeaderError::InvalidHeaderValue => "invalid-header-value",
            HeaderError::InvalidHeaderName => "invalid-header-name",
        }
    }
    pub fn message(&self) -> &'static str {
        match self {
            HeaderError::InvalidHeaderValue => "the given header value is not valid",
            HeaderError::InvalidHeaderName => "the given header name is not valid",
        }
    }
}
impl ::core::fmt::Debug for HeaderError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("HeaderError")
            .field("code", &(*self as i32))
            .field("name", &self.name())
            .field("message", &self.message())
            .finish()
    }
}
impl ::core::fmt::Display for HeaderError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        write!(f, "{} (error {})", self.name(), * self as i32)
    }
}
impl std::error::Error for HeaderError {}
impl HeaderError {
    #[doc(hidden)]
    pub unsafe fn _lift(val: u8) -> HeaderError {
        if !cfg!(debug_assertions) {
            return ::core::mem::transmute(val);
        }
        match val {
            0 => HeaderError::InvalidHeaderValue,
            1 => HeaderError::InvalidHeaderName,
            _ => panic!("invalid enum discriminant"),
        }
    }
}
/// Error variant sent if failing to write to access log.
#[derive(Clone)]
pub enum LogError {
    /// The log channel is over capacity. The data is returned to the caller.
    ChannelFull(_rt::Vec<u8>),
    /// The channel is closed.
    ChannelClosed,
}
impl ::core::fmt::Debug for LogError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            LogError::ChannelFull(e) => {
                f.debug_tuple("LogError::ChannelFull").field(e).finish()
            }
            LogError::ChannelClosed => f.debug_tuple("LogError::ChannelClosed").finish(),
        }
    }
}
impl ::core::fmt::Display for LogError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        write!(f, "{:?}", self)
    }
}
impl std::error::Error for LogError {}
/// A context object is available in all hooks during the whole request
/// lifecycle. It can be used to store custom data in one hook and make it
/// available in the hooks executed later in the request.
///
/// This resource provides mutable access to the context and is available only
/// in the gateway request hook.
#[derive(Debug)]
#[repr(transparent)]
pub struct Context {
    handle: _rt::Resource<Context>,
}
impl Context {
    #[doc(hidden)]
    pub unsafe fn from_handle(handle: u32) -> Self {
        Self {
            handle: _rt::Resource::from_handle(handle),
        }
    }
    #[doc(hidden)]
    pub fn take_handle(&self) -> u32 {
        _rt::Resource::take_handle(&self.handle)
    }
    #[doc(hidden)]
    pub fn handle(&self) -> u32 {
        _rt::Resource::handle(&self.handle)
    }
}
unsafe impl _rt::WasmResource for Context {
    #[inline]
    unsafe fn drop(_handle: u32) {
        #[cfg(not(target_arch = "wasm32"))]
        unreachable!();
        #[cfg(target_arch = "wasm32")]
        {
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[resource-drop]context"]
                fn drop(_: u32);
            }
            drop(_handle);
        }
    }
}
/// The context as a read-only object.
#[derive(Debug)]
#[repr(transparent)]
pub struct SharedContext {
    handle: _rt::Resource<SharedContext>,
}
impl SharedContext {
    #[doc(hidden)]
    pub unsafe fn from_handle(handle: u32) -> Self {
        Self {
            handle: _rt::Resource::from_handle(handle),
        }
    }
    #[doc(hidden)]
    pub fn take_handle(&self) -> u32 {
        _rt::Resource::take_handle(&self.handle)
    }
    #[doc(hidden)]
    pub fn handle(&self) -> u32 {
        _rt::Resource::handle(&self.handle)
    }
}
unsafe impl _rt::WasmResource for SharedContext {
    #[inline]
    unsafe fn drop(_handle: u32) {
        #[cfg(not(target_arch = "wasm32"))]
        unreachable!();
        #[cfg(target_arch = "wasm32")]
        {
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[resource-drop]shared-context"]
                fn drop(_: u32);
            }
            drop(_handle);
        }
    }
}
/// Provides access to the request headers. Available in a mutable form
/// only in the gateway request hook.
#[derive(Debug)]
#[repr(transparent)]
pub struct Headers {
    handle: _rt::Resource<Headers>,
}
impl Headers {
    #[doc(hidden)]
    pub unsafe fn from_handle(handle: u32) -> Self {
        Self {
            handle: _rt::Resource::from_handle(handle),
        }
    }
    #[doc(hidden)]
    pub fn take_handle(&self) -> u32 {
        _rt::Resource::take_handle(&self.handle)
    }
    #[doc(hidden)]
    pub fn handle(&self) -> u32 {
        _rt::Resource::handle(&self.handle)
    }
}
unsafe impl _rt::WasmResource for Headers {
    #[inline]
    unsafe fn drop(_handle: u32) {
        #[cfg(not(target_arch = "wasm32"))]
        unreachable!();
        #[cfg(target_arch = "wasm32")]
        {
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[resource-drop]headers"]
                fn drop(_: u32);
            }
            drop(_handle);
        }
    }
}
/// Defines an edge in a type
#[derive(Clone)]
pub struct EdgeDefinition {
    /// The name of the type the edge is part of
    pub parent_type_name: _rt::String,
    /// The name of the field of this edge
    pub field_name: _rt::String,
}
impl ::core::fmt::Debug for EdgeDefinition {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("EdgeDefinition")
            .field("parent-type-name", &self.parent_type_name)
            .field("field-name", &self.field_name)
            .finish()
    }
}
/// Defines a node
#[derive(Clone)]
pub struct NodeDefinition {
    /// The name of the type of this node
    pub type_name: _rt::String,
}
impl ::core::fmt::Debug for NodeDefinition {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("NodeDefinition").field("type-name", &self.type_name).finish()
    }
}
/// Info about an executed HTTP request.
#[derive(Clone)]
pub struct ExecutedHttpRequest {
    /// The request method.
    pub method: _rt::String,
    /// The request URL.
    pub url: _rt::String,
    /// The response status code.
    pub status_code: u16,
    /// The outputs of executed on-operation-response hooks for every operation of the request.
    pub on_operation_response_outputs: _rt::Vec<_rt::Vec<u8>>,
}
impl ::core::fmt::Debug for ExecutedHttpRequest {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("ExecutedHttpRequest")
            .field("method", &self.method)
            .field("url", &self.url)
            .field("status-code", &self.status_code)
            .field("on-operation-response-outputs", &self.on_operation_response_outputs)
            .finish()
    }
}
/// An error returned from a field.
#[repr(C)]
#[derive(Clone, Copy)]
pub struct FieldError {
    /// The number of errors.
    pub count: u64,
    /// The returned data is null.
    pub data_is_null: bool,
}
impl ::core::fmt::Debug for FieldError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("FieldError")
            .field("count", &self.count)
            .field("data-is-null", &self.data_is_null)
            .finish()
    }
}
/// An error from a GraphQL request.
#[repr(C)]
#[derive(Clone, Copy)]
pub struct RequestError {
    /// The number of errors.
    pub count: u64,
}
impl ::core::fmt::Debug for RequestError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("RequestError").field("count", &self.count).finish()
    }
}
/// A status of a GraphQL operation.
#[derive(Clone, Copy)]
pub enum GraphqlResponseStatus {
    /// Request was successful.
    Success,
    /// A field returned an error.
    FieldError(FieldError),
    /// A request error.
    RequestError(RequestError),
    /// The request was refused.
    RefusedRequest,
}
impl ::core::fmt::Debug for GraphqlResponseStatus {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            GraphqlResponseStatus::Success => {
                f.debug_tuple("GraphqlResponseStatus::Success").finish()
            }
            GraphqlResponseStatus::FieldError(e) => {
                f.debug_tuple("GraphqlResponseStatus::FieldError").field(e).finish()
            }
            GraphqlResponseStatus::RequestError(e) => {
                f.debug_tuple("GraphqlResponseStatus::RequestError").field(e).finish()
            }
            GraphqlResponseStatus::RefusedRequest => {
                f.debug_tuple("GraphqlResponseStatus::RefusedRequest").finish()
            }
        }
    }
}
/// Info about an executed operation.
#[derive(Clone)]
pub struct ExecutedOperation {
    /// The name of the operation, if present.
    pub name: Option<_rt::String>,
    /// The operation document in sanitized form.
    pub document: _rt::String,
    /// The time taken in preparing.
    pub prepare_duration_ms: u64,
    /// True, if the plan was taken from cache.
    pub cached_plan: bool,
    /// Time in milliseconds spent executing the operation.
    pub duration_ms: u64,
    /// The status of the operation.
    pub status: GraphqlResponseStatus,
    /// If queried any subgraphs, the outputs of on-subgraph-response hooks.
    /// Will be empty if no subgraphs were called.
    pub on_subgraph_response_outputs: _rt::Vec<_rt::Vec<u8>>,
}
impl ::core::fmt::Debug for ExecutedOperation {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("ExecutedOperation")
            .field("name", &self.name)
            .field("document", &self.document)
            .field("prepare-duration-ms", &self.prepare_duration_ms)
            .field("cached-plan", &self.cached_plan)
            .field("duration-ms", &self.duration_ms)
            .field("status", &self.status)
            .field("on-subgraph-response-outputs", &self.on_subgraph_response_outputs)
            .finish()
    }
}
/// Information on a response
#[repr(C)]
#[derive(Clone, Copy)]
pub struct SubgraphResponse {
    /// The milliseconds it took to connect to the host.
    pub connection_time_ms: u64,
    /// The milliseconds it took for the host to respond with data.
    pub response_time_ms: u64,
    /// The response status code
    pub status_code: u16,
}
impl ::core::fmt::Debug for SubgraphResponse {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("SubgraphResponse")
            .field("connection-time-ms", &self.connection_time_ms)
            .field("response-time-ms", &self.response_time_ms)
            .field("status-code", &self.status_code)
            .finish()
    }
}
/// Cache status of a subgraph call.
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum CacheStatus {
    /// All data fetched from cache.
    Hit,
    /// Some data fetched from cache.
    PartialHit,
    /// Cache miss
    Miss,
}
impl ::core::fmt::Debug for CacheStatus {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            CacheStatus::Hit => f.debug_tuple("CacheStatus::Hit").finish(),
            CacheStatus::PartialHit => f.debug_tuple("CacheStatus::PartialHit").finish(),
            CacheStatus::Miss => f.debug_tuple("CacheStatus::Miss").finish(),
        }
    }
}
impl CacheStatus {
    #[doc(hidden)]
    pub unsafe fn _lift(val: u8) -> CacheStatus {
        if !cfg!(debug_assertions) {
            return ::core::mem::transmute(val);
        }
        match val {
            0 => CacheStatus::Hit,
            1 => CacheStatus::PartialHit,
            2 => CacheStatus::Miss,
            _ => panic!("invalid enum discriminant"),
        }
    }
}
/// Subgraph response variant.
#[derive(Clone, Copy)]
pub enum SubgraphRequestExecutionKind {
    /// Internal server error in the gateway.
    InternalServerError,
    /// Response prevented by subgraph request hook.
    HookError,
    /// HTTP request failed.
    RequestError,
    /// Request was rate-limited.
    RateLimited,
    /// A response was received.
    Response(SubgraphResponse),
}
impl ::core::fmt::Debug for SubgraphRequestExecutionKind {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            SubgraphRequestExecutionKind::InternalServerError => {
                f.debug_tuple("SubgraphRequestExecutionKind::InternalServerError")
                    .finish()
            }
            SubgraphRequestExecutionKind::HookError => {
                f.debug_tuple("SubgraphRequestExecutionKind::HookError").finish()
            }
            SubgraphRequestExecutionKind::RequestError => {
                f.debug_tuple("SubgraphRequestExecutionKind::RequestError").finish()
            }
            SubgraphRequestExecutionKind::RateLimited => {
                f.debug_tuple("SubgraphRequestExecutionKind::RateLimited").finish()
            }
            SubgraphRequestExecutionKind::Response(e) => {
                f.debug_tuple("SubgraphRequestExecutionKind::Response").field(e).finish()
            }
        }
    }
}
/// Info about an executed subgraph request.
#[derive(Clone)]
pub struct ExecutedSubgraphRequest {
    /// The name of the subgraph.
    pub subgraph_name: _rt::String,
    /// The request method.
    pub method: _rt::String,
    /// The subgraph URL.
    pub url: _rt::String,
    /// The subgraph responses
    pub executions: _rt::Vec<SubgraphRequestExecutionKind>,
    /// The cache status of the subgraph call.
    pub cache_status: CacheStatus,
    /// The time in milliseconds taken for the whole operation.
    pub total_duration_ms: u64,
    /// True, if the subgraph returned any errors.
    pub has_errors: bool,
}
impl ::core::fmt::Debug for ExecutedSubgraphRequest {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("ExecutedSubgraphRequest")
            .field("subgraph-name", &self.subgraph_name)
            .field("method", &self.method)
            .field("url", &self.url)
            .field("executions", &self.executions)
            .field("cache-status", &self.cache_status)
            .field("total-duration-ms", &self.total_duration_ms)
            .field("has-errors", &self.has_errors)
            .finish()
    }
}
/// An error response can be used to inject an error to the GraphQL response.
#[derive(Clone)]
pub struct Error {
    /// Adds the given extensions to the response extensions. The first item in
    /// the tuple is the extension key, and the second item is the extension value.
    /// The extension value can be string-encoded JSON, which will be converted as
    /// JSON in the response. It can also be just a string, which will be converted as
    /// a JSON string in the response.
    pub extensions: _rt::Vec<(_rt::String, _rt::String)>,
    /// The error message.
    pub message: _rt::String,
}
impl ::core::fmt::Debug for Error {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("Error")
            .field("extensions", &self.extensions)
            .field("message", &self.message)
            .finish()
    }
}
impl ::core::fmt::Display for Error {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        write!(f, "{:?}", self)
    }
}
impl std::error::Error for Error {}
/// An HTTP error response.
#[derive(Clone)]
pub struct ErrorResponse {
    /// HTTP status code. Must be a valid status code. If not, the status code will be 500.
    pub status_code: u16,
    /// List of GraphQL errors.
    pub errors: _rt::Vec<Error>,
}
impl ::core::fmt::Debug for ErrorResponse {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("ErrorResponse")
            .field("status-code", &self.status_code)
            .field("errors", &self.errors)
            .finish()
    }
}
impl ::core::fmt::Display for ErrorResponse {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        write!(f, "{:?}", self)
    }
}
impl std::error::Error for ErrorResponse {}
/// A HTTP client.
#[derive(Debug)]
#[repr(transparent)]
pub struct HttpClient {
    handle: _rt::Resource<HttpClient>,
}
impl HttpClient {
    #[doc(hidden)]
    pub unsafe fn from_handle(handle: u32) -> Self {
        Self {
            handle: _rt::Resource::from_handle(handle),
        }
    }
    #[doc(hidden)]
    pub fn take_handle(&self) -> u32 {
        _rt::Resource::take_handle(&self.handle)
    }
    #[doc(hidden)]
    pub fn handle(&self) -> u32 {
        _rt::Resource::handle(&self.handle)
    }
}
unsafe impl _rt::WasmResource for HttpClient {
    #[inline]
    unsafe fn drop(_handle: u32) {
        #[cfg(not(target_arch = "wasm32"))]
        unreachable!();
        #[cfg(target_arch = "wasm32")]
        {
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[resource-drop]http-client"]
                fn drop(_: u32);
            }
            drop(_handle);
        }
    }
}
/// A sender for the system access log.
#[derive(Debug)]
#[repr(transparent)]
pub struct AccessLog {
    handle: _rt::Resource<AccessLog>,
}
impl AccessLog {
    #[doc(hidden)]
    pub unsafe fn from_handle(handle: u32) -> Self {
        Self {
            handle: _rt::Resource::from_handle(handle),
        }
    }
    #[doc(hidden)]
    pub fn take_handle(&self) -> u32 {
        _rt::Resource::take_handle(&self.handle)
    }
    #[doc(hidden)]
    pub fn handle(&self) -> u32 {
        _rt::Resource::handle(&self.handle)
    }
}
unsafe impl _rt::WasmResource for AccessLog {
    #[inline]
    unsafe fn drop(_handle: u32) {
        #[cfg(not(target_arch = "wasm32"))]
        unreachable!();
        #[cfg(target_arch = "wasm32")]
        {
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[resource-drop]access-log"]
                fn drop(_: u32);
            }
            drop(_handle);
        }
    }
}
/// The HTTP method.
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum HttpMethod {
    /// The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
    Get,
    /// The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
    Post,
    /// The PUT method replaces all current representations of the target resource with the request payload.
    Put,
    /// The DELETE method deletes the specified resource.
    Delete,
    /// The PATCH method is used to apply partial modifications to a resource.
    Patch,
    /// The HEAD method asks for a response identical to that of a GET request, but without the response body.
    Head,
    /// The OPTIONS method is used to describe the communication options for the target resource.
    Options,
    /// The CONNECT method establishes a tunnel to the server identified by the target resource.
    Connect,
    /// The TRACE method performs a message loop-back test along the path to the target resource.
    Trace,
}
impl ::core::fmt::Debug for HttpMethod {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            HttpMethod::Get => f.debug_tuple("HttpMethod::Get").finish(),
            HttpMethod::Post => f.debug_tuple("HttpMethod::Post").finish(),
            HttpMethod::Put => f.debug_tuple("HttpMethod::Put").finish(),
            HttpMethod::Delete => f.debug_tuple("HttpMethod::Delete").finish(),
            HttpMethod::Patch => f.debug_tuple("HttpMethod::Patch").finish(),
            HttpMethod::Head => f.debug_tuple("HttpMethod::Head").finish(),
            HttpMethod::Options => f.debug_tuple("HttpMethod::Options").finish(),
            HttpMethod::Connect => f.debug_tuple("HttpMethod::Connect").finish(),
            HttpMethod::Trace => f.debug_tuple("HttpMethod::Trace").finish(),
        }
    }
}
impl HttpMethod {
    #[doc(hidden)]
    pub unsafe fn _lift(val: u8) -> HttpMethod {
        if !cfg!(debug_assertions) {
            return ::core::mem::transmute(val);
        }
        match val {
            0 => HttpMethod::Get,
            1 => HttpMethod::Post,
            2 => HttpMethod::Put,
            3 => HttpMethod::Delete,
            4 => HttpMethod::Patch,
            5 => HttpMethod::Head,
            6 => HttpMethod::Options,
            7 => HttpMethod::Connect,
            8 => HttpMethod::Trace,
            _ => panic!("invalid enum discriminant"),
        }
    }
}
/// A HTTP request.
#[derive(Clone)]
pub struct HttpRequest {
    /// The HTTP method.
    pub method: HttpMethod,
    /// The URL to send the request to.
    pub url: _rt::String,
    /// The headers to send with the request. Keys and values must be ASCII strings.
    pub headers: _rt::Vec<(_rt::String, _rt::String)>,
    /// The body of the request. If the body is set, the Content-Type header must be set.
    pub body: _rt::Vec<u8>,
    /// The timeout in milliseconds for the request. If not set, no timeout is used.
    pub timeout_ms: Option<u64>,
}
impl ::core::fmt::Debug for HttpRequest {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("HttpRequest")
            .field("method", &self.method)
            .field("url", &self.url)
            .field("headers", &self.headers)
            .field("body", &self.body)
            .field("timeout-ms", &self.timeout_ms)
            .finish()
    }
}
/// The HTTP version.
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum HttpVersion {
    /// The HTTP/0.9 version.
    Http09,
    /// The HTTP/1.0 version.
    Http10,
    /// The HTTP/1.1 version.
    Http11,
    /// The HTTP/2.0 version.
    Http20,
    /// The HTTP/3.0 version.
    Http30,
}
impl ::core::fmt::Debug for HttpVersion {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            HttpVersion::Http09 => f.debug_tuple("HttpVersion::Http09").finish(),
            HttpVersion::Http10 => f.debug_tuple("HttpVersion::Http10").finish(),
            HttpVersion::Http11 => f.debug_tuple("HttpVersion::Http11").finish(),
            HttpVersion::Http20 => f.debug_tuple("HttpVersion::Http20").finish(),
            HttpVersion::Http30 => f.debug_tuple("HttpVersion::Http30").finish(),
        }
    }
}
impl HttpVersion {
    #[doc(hidden)]
    pub unsafe fn _lift(val: u8) -> HttpVersion {
        if !cfg!(debug_assertions) {
            return ::core::mem::transmute(val);
        }
        match val {
            0 => HttpVersion::Http09,
            1 => HttpVersion::Http10,
            2 => HttpVersion::Http11,
            3 => HttpVersion::Http20,
            4 => HttpVersion::Http30,
            _ => panic!("invalid enum discriminant"),
        }
    }
}
/// An HTTP response.
#[derive(Clone)]
pub struct HttpResponse {
    /// The HTTP status code.
    pub status: u16,
    /// The HTTP version.
    pub version: HttpVersion,
    /// The headers of the response.
    pub headers: _rt::Vec<(_rt::String, _rt::String)>,
    /// The body of the response.
    pub body: _rt::Vec<u8>,
}
impl ::core::fmt::Debug for HttpResponse {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("HttpResponse")
            .field("status", &self.status)
            .field("version", &self.version)
            .field("headers", &self.headers)
            .field("body", &self.body)
            .finish()
    }
}
/// An HTTP error.
#[derive(Clone)]
pub enum HttpError {
    /// The request timed out.
    Timeout,
    /// The request failed due to an error (invalid user data).
    Request(_rt::String),
    /// The request failed due to an error (server connection failed).
    Connect(_rt::String),
}
impl ::core::fmt::Debug for HttpError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            HttpError::Timeout => f.debug_tuple("HttpError::Timeout").finish(),
            HttpError::Request(e) => {
                f.debug_tuple("HttpError::Request").field(e).finish()
            }
            HttpError::Connect(e) => {
                f.debug_tuple("HttpError::Connect").field(e).finish()
            }
        }
    }
}
impl ::core::fmt::Display for HttpError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        write!(f, "{:?}", self)
    }
}
impl std::error::Error for HttpError {}
impl Context {
    #[allow(unused_unsafe, clippy::all)]
    /// Fetches a context value with the given name, if existing.
    pub fn get(&self, name: &str) -> Option<_rt::String> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 12]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]);
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]context.get"]
                fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1);
            let l2 = i32::from(*ptr1.add(0).cast::<u8>());
            match l2 {
                0 => None,
                1 => {
                    let e = {
                        let l3 = *ptr1.add(4).cast::<*mut u8>();
                        let l4 = *ptr1.add(8).cast::<usize>();
                        let len5 = l4;
                        let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
                        _rt::string_lift(bytes5)
                    };
                    Some(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl Context {
    #[allow(unused_unsafe, clippy::all)]
    /// Stores a context value with the given name.
    pub fn set(&self, name: &str, value: &str) {
        unsafe {
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let vec1 = value;
            let ptr1 = vec1.as_ptr().cast::<u8>();
            let len1 = vec1.len();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]context.set"]
                fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8, _: usize);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8, _: usize) {
                unreachable!()
            }
            wit_import(
                (self).handle() as i32,
                ptr0.cast_mut(),
                len0,
                ptr1.cast_mut(),
                len1,
            );
        }
    }
}
impl Context {
    #[allow(unused_unsafe, clippy::all)]
    /// Deletes a context value with the given name. Returns the value
    /// if existing.
    pub fn delete(&self, name: &str) -> Option<_rt::String> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 12]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]);
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]context.delete"]
                fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1);
            let l2 = i32::from(*ptr1.add(0).cast::<u8>());
            match l2 {
                0 => None,
                1 => {
                    let e = {
                        let l3 = *ptr1.add(4).cast::<*mut u8>();
                        let l4 = *ptr1.add(8).cast::<usize>();
                        let len5 = l4;
                        let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
                        _rt::string_lift(bytes5)
                    };
                    Some(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl SharedContext {
    #[allow(unused_unsafe, clippy::all)]
    /// Fetches a context value with the given name, if existing.
    pub fn get(&self, name: &str) -> Option<_rt::String> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 12]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]);
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]shared-context.get"]
                fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1);
            let l2 = i32::from(*ptr1.add(0).cast::<u8>());
            match l2 {
                0 => None,
                1 => {
                    let e = {
                        let l3 = *ptr1.add(4).cast::<*mut u8>();
                        let l4 = *ptr1.add(8).cast::<usize>();
                        let len5 = l4;
                        let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
                        _rt::string_lift(bytes5)
                    };
                    Some(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl SharedContext {
    #[allow(unused_unsafe, clippy::all)]
    /// Gets the current trace-id.
    pub fn trace_id(&self) -> _rt::String {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 8]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]);
            let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]shared-context.trace-id"]
                fn wit_import(_: i32, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0);
            let l1 = *ptr0.add(0).cast::<*mut u8>();
            let l2 = *ptr0.add(4).cast::<usize>();
            let len3 = l2;
            let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3);
            _rt::string_lift(bytes3)
        }
    }
}
impl Headers {
    #[allow(unused_unsafe, clippy::all)]
    /// Gets a header value with the given name.
    pub fn get(&self, name: &str) -> Option<_rt::String> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 12]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]);
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]headers.get"]
                fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1);
            let l2 = i32::from(*ptr1.add(0).cast::<u8>());
            match l2 {
                0 => None,
                1 => {
                    let e = {
                        let l3 = *ptr1.add(4).cast::<*mut u8>();
                        let l4 = *ptr1.add(8).cast::<usize>();
                        let len5 = l4;
                        let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
                        _rt::string_lift(bytes5)
                    };
                    Some(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl Headers {
    #[allow(unused_unsafe, clippy::all)]
    /// Sets the header value with the given name. Returns an error if the given name
    /// is not a valid header name.
    pub fn set(&self, name: &str, value: &str) -> Result<(), HeaderError> {
        unsafe {
            #[repr(align(1))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 2]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]);
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let vec1 = value;
            let ptr1 = vec1.as_ptr().cast::<u8>();
            let len1 = vec1.len();
            let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]headers.set"]
                fn wit_import(
                    _: i32,
                    _: *mut u8,
                    _: usize,
                    _: *mut u8,
                    _: usize,
                    _: *mut u8,
                );
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(
                _: i32,
                _: *mut u8,
                _: usize,
                _: *mut u8,
                _: usize,
                _: *mut u8,
            ) {
                unreachable!()
            }
            wit_import(
                (self).handle() as i32,
                ptr0.cast_mut(),
                len0,
                ptr1.cast_mut(),
                len1,
                ptr2,
            );
            let l3 = i32::from(*ptr2.add(0).cast::<u8>());
            match l3 {
                0 => {
                    let e = ();
                    Ok(e)
                }
                1 => {
                    let e = {
                        let l4 = i32::from(*ptr2.add(1).cast::<u8>());
                        HeaderError::_lift(l4 as u8)
                    };
                    Err(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl Headers {
    #[allow(unused_unsafe, clippy::all)]
    /// Deletes a header value with the given name.
    pub fn delete(&self, name: &str) -> Option<_rt::String> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 12]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]);
            let vec0 = name;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]headers.delete"]
                fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1);
            let l2 = i32::from(*ptr1.add(0).cast::<u8>());
            match l2 {
                0 => None,
                1 => {
                    let e = {
                        let l3 = *ptr1.add(4).cast::<*mut u8>();
                        let l4 = *ptr1.add(8).cast::<usize>();
                        let len5 = l4;
                        let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
                        _rt::string_lift(bytes5)
                    };
                    Some(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl Headers {
    #[allow(unused_unsafe, clippy::all)]
    /// Return all headers as a list of tuples.
    pub fn entries(&self) -> _rt::Vec<(_rt::String, _rt::String)> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 8]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]);
            let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[method]headers.entries"]
                fn wit_import(_: i32, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: i32, _: *mut u8) {
                unreachable!()
            }
            wit_import((self).handle() as i32, ptr0);
            let l1 = *ptr0.add(0).cast::<*mut u8>();
            let l2 = *ptr0.add(4).cast::<usize>();
            let base9 = l1;
            let len9 = l2;
            let mut result9 = _rt::Vec::with_capacity(len9);
            for i in 0..len9 {
                let base = base9.add(i * 16);
                let e9 = {
                    let l3 = *base.add(0).cast::<*mut u8>();
                    let l4 = *base.add(4).cast::<usize>();
                    let len5 = l4;
                    let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
                    let l6 = *base.add(8).cast::<*mut u8>();
                    let l7 = *base.add(12).cast::<usize>();
                    let len8 = l7;
                    let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
                    (_rt::string_lift(bytes5), _rt::string_lift(bytes8))
                };
                result9.push(e9);
            }
            _rt::cabi_dealloc(base9, len9 * 16, 4);
            result9
        }
    }
}
impl HttpClient {
    #[allow(unused_unsafe, clippy::all)]
    /// Executes a request and returns the response, yielding the current future until finished.
    pub fn execute(request: &HttpRequest) -> Result<HttpResponse, HttpError> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 24]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 24]);
            let HttpRequest {
                method: method0,
                url: url0,
                headers: headers0,
                body: body0,
                timeout_ms: timeout_ms0,
            } = request;
            let vec1 = url0;
            let ptr1 = vec1.as_ptr().cast::<u8>();
            let len1 = vec1.len();
            let vec5 = headers0;
            let len5 = vec5.len();
            let layout5 = _rt::alloc::Layout::from_size_align_unchecked(
                vec5.len() * 16,
                4,
            );
            let result5 = if layout5.size() != 0 {
                let ptr = _rt::alloc::alloc(layout5).cast::<u8>();
                if ptr.is_null() {
                    _rt::alloc::handle_alloc_error(layout5);
                }
                ptr
            } else {
                ::core::ptr::null_mut()
            };
            for (i, e) in vec5.into_iter().enumerate() {
                let base = result5.add(i * 16);
                {
                    let (t2_0, t2_1) = e;
                    let vec3 = t2_0;
                    let ptr3 = vec3.as_ptr().cast::<u8>();
                    let len3 = vec3.len();
                    *base.add(4).cast::<usize>() = len3;
                    *base.add(0).cast::<*mut u8>() = ptr3.cast_mut();
                    let vec4 = t2_1;
                    let ptr4 = vec4.as_ptr().cast::<u8>();
                    let len4 = vec4.len();
                    *base.add(12).cast::<usize>() = len4;
                    *base.add(8).cast::<*mut u8>() = ptr4.cast_mut();
                }
            }
            let vec6 = body0;
            let ptr6 = vec6.as_ptr().cast::<u8>();
            let len6 = vec6.len();
            let (result7_0, result7_1) = match timeout_ms0 {
                Some(e) => (1i32, _rt::as_i64(e)),
                None => (0i32, 0i64),
            };
            let ptr8 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[static]http-client.execute"]
                fn wit_import(
                    _: i32,
                    _: *mut u8,
                    _: usize,
                    _: *mut u8,
                    _: usize,
                    _: *mut u8,
                    _: usize,
                    _: i32,
                    _: i64,
                    _: *mut u8,
                );
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(
                _: i32,
                _: *mut u8,
                _: usize,
                _: *mut u8,
                _: usize,
                _: *mut u8,
                _: usize,
                _: i32,
                _: i64,
                _: *mut u8,
            ) {
                unreachable!()
            }
            wit_import(
                method0.clone() as i32,
                ptr1.cast_mut(),
                len1,
                result5,
                len5,
                ptr6.cast_mut(),
                len6,
                result7_0,
                result7_1,
                ptr8,
            );
            let l9 = i32::from(*ptr8.add(0).cast::<u8>());
            if layout5.size() != 0 {
                _rt::alloc::dealloc(result5.cast(), layout5);
            }
            match l9 {
                0 => {
                    let e = {
                        let l10 = i32::from(*ptr8.add(4).cast::<u16>());
                        let l11 = i32::from(*ptr8.add(6).cast::<u8>());
                        let l12 = *ptr8.add(8).cast::<*mut u8>();
                        let l13 = *ptr8.add(12).cast::<usize>();
                        let base20 = l12;
                        let len20 = l13;
                        let mut result20 = _rt::Vec::with_capacity(len20);
                        for i in 0..len20 {
                            let base = base20.add(i * 16);
                            let e20 = {
                                let l14 = *base.add(0).cast::<*mut u8>();
                                let l15 = *base.add(4).cast::<usize>();
                                let len16 = l15;
                                let bytes16 = _rt::Vec::from_raw_parts(
                                    l14.cast(),
                                    len16,
                                    len16,
                                );
                                let l17 = *base.add(8).cast::<*mut u8>();
                                let l18 = *base.add(12).cast::<usize>();
                                let len19 = l18;
                                let bytes19 = _rt::Vec::from_raw_parts(
                                    l17.cast(),
                                    len19,
                                    len19,
                                );
                                (_rt::string_lift(bytes16), _rt::string_lift(bytes19))
                            };
                            result20.push(e20);
                        }
                        _rt::cabi_dealloc(base20, len20 * 16, 4);
                        let l21 = *ptr8.add(16).cast::<*mut u8>();
                        let l22 = *ptr8.add(20).cast::<usize>();
                        let len23 = l22;
                        HttpResponse {
                            status: l10 as u16,
                            version: HttpVersion::_lift(l11 as u8),
                            headers: result20,
                            body: _rt::Vec::from_raw_parts(l21.cast(), len23, len23),
                        }
                    };
                    Ok(e)
                }
                1 => {
                    let e = {
                        let l24 = i32::from(*ptr8.add(4).cast::<u8>());
                        let v31 = match l24 {
                            0 => HttpError::Timeout,
                            1 => {
                                let e31 = {
                                    let l25 = *ptr8.add(8).cast::<*mut u8>();
                                    let l26 = *ptr8.add(12).cast::<usize>();
                                    let len27 = l26;
                                    let bytes27 = _rt::Vec::from_raw_parts(
                                        l25.cast(),
                                        len27,
                                        len27,
                                    );
                                    _rt::string_lift(bytes27)
                                };
                                HttpError::Request(e31)
                            }
                            n => {
                                debug_assert_eq!(n, 2, "invalid enum discriminant");
                                let e31 = {
                                    let l28 = *ptr8.add(8).cast::<*mut u8>();
                                    let l29 = *ptr8.add(12).cast::<usize>();
                                    let len30 = l29;
                                    let bytes30 = _rt::Vec::from_raw_parts(
                                        l28.cast(),
                                        len30,
                                        len30,
                                    );
                                    _rt::string_lift(bytes30)
                                };
                                HttpError::Connect(e31)
                            }
                        };
                        v31
                    };
                    Err(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
impl HttpClient {
    #[allow(unused_unsafe, clippy::all)]
    /// Executes multiple requests in parallel, yielding the current future until all requests are done.
    pub fn execute_many(
        requests: &[HttpRequest],
    ) -> _rt::Vec<Result<HttpResponse, HttpError>> {
        unsafe {
            let mut cleanup_list = _rt::Vec::new();
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 8]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]);
            let vec7 = requests;
            let len7 = vec7.len();
            let layout7 = _rt::alloc::Layout::from_size_align_unchecked(
                vec7.len() * 48,
                8,
            );
            let result7 = if layout7.size() != 0 {
                let ptr = _rt::alloc::alloc(layout7).cast::<u8>();
                if ptr.is_null() {
                    _rt::alloc::handle_alloc_error(layout7);
                }
                ptr
            } else {
                ::core::ptr::null_mut()
            };
            for (i, e) in vec7.into_iter().enumerate() {
                let base = result7.add(i * 48);
                {
                    let HttpRequest {
                        method: method0,
                        url: url0,
                        headers: headers0,
                        body: body0,
                        timeout_ms: timeout_ms0,
                    } = e;
                    *base.add(0).cast::<u8>() = (method0.clone() as i32) as u8;
                    let vec1 = url0;
                    let ptr1 = vec1.as_ptr().cast::<u8>();
                    let len1 = vec1.len();
                    *base.add(8).cast::<usize>() = len1;
                    *base.add(4).cast::<*mut u8>() = ptr1.cast_mut();
                    let vec5 = headers0;
                    let len5 = vec5.len();
                    let layout5 = _rt::alloc::Layout::from_size_align_unchecked(
                        vec5.len() * 16,
                        4,
                    );
                    let result5 = if layout5.size() != 0 {
                        let ptr = _rt::alloc::alloc(layout5).cast::<u8>();
                        if ptr.is_null() {
                            _rt::alloc::handle_alloc_error(layout5);
                        }
                        ptr
                    } else {
                        ::core::ptr::null_mut()
                    };
                    for (i, e) in vec5.into_iter().enumerate() {
                        let base = result5.add(i * 16);
                        {
                            let (t2_0, t2_1) = e;
                            let vec3 = t2_0;
                            let ptr3 = vec3.as_ptr().cast::<u8>();
                            let len3 = vec3.len();
                            *base.add(4).cast::<usize>() = len3;
                            *base.add(0).cast::<*mut u8>() = ptr3.cast_mut();
                            let vec4 = t2_1;
                            let ptr4 = vec4.as_ptr().cast::<u8>();
                            let len4 = vec4.len();
                            *base.add(12).cast::<usize>() = len4;
                            *base.add(8).cast::<*mut u8>() = ptr4.cast_mut();
                        }
                    }
                    *base.add(16).cast::<usize>() = len5;
                    *base.add(12).cast::<*mut u8>() = result5;
                    let vec6 = body0;
                    let ptr6 = vec6.as_ptr().cast::<u8>();
                    let len6 = vec6.len();
                    *base.add(24).cast::<usize>() = len6;
                    *base.add(20).cast::<*mut u8>() = ptr6.cast_mut();
                    match timeout_ms0 {
                        Some(e) => {
                            *base.add(32).cast::<u8>() = (1i32) as u8;
                            *base.add(40).cast::<i64>() = _rt::as_i64(e);
                        }
                        None => {
                            *base.add(32).cast::<u8>() = (0i32) as u8;
                        }
                    };
                    cleanup_list.extend_from_slice(&[(result5, layout5)]);
                }
            }
            let ptr8 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[static]http-client.execute-many"]
                fn wit_import(_: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import(result7, len7, ptr8);
            let l9 = *ptr8.add(0).cast::<*mut u8>();
            let l10 = *ptr8.add(4).cast::<usize>();
            let base34 = l9;
            let len34 = l10;
            let mut result34 = _rt::Vec::with_capacity(len34);
            for i in 0..len34 {
                let base = base34.add(i * 24);
                let e34 = {
                    let l11 = i32::from(*base.add(0).cast::<u8>());
                    match l11 {
                        0 => {
                            let e = {
                                let l12 = i32::from(*base.add(4).cast::<u16>());
                                let l13 = i32::from(*base.add(6).cast::<u8>());
                                let l14 = *base.add(8).cast::<*mut u8>();
                                let l15 = *base.add(12).cast::<usize>();
                                let base22 = l14;
                                let len22 = l15;
                                let mut result22 = _rt::Vec::with_capacity(len22);
                                for i in 0..len22 {
                                    let base = base22.add(i * 16);
                                    let e22 = {
                                        let l16 = *base.add(0).cast::<*mut u8>();
                                        let l17 = *base.add(4).cast::<usize>();
                                        let len18 = l17;
                                        let bytes18 = _rt::Vec::from_raw_parts(
                                            l16.cast(),
                                            len18,
                                            len18,
                                        );
                                        let l19 = *base.add(8).cast::<*mut u8>();
                                        let l20 = *base.add(12).cast::<usize>();
                                        let len21 = l20;
                                        let bytes21 = _rt::Vec::from_raw_parts(
                                            l19.cast(),
                                            len21,
                                            len21,
                                        );
                                        (_rt::string_lift(bytes18), _rt::string_lift(bytes21))
                                    };
                                    result22.push(e22);
                                }
                                _rt::cabi_dealloc(base22, len22 * 16, 4);
                                let l23 = *base.add(16).cast::<*mut u8>();
                                let l24 = *base.add(20).cast::<usize>();
                                let len25 = l24;
                                HttpResponse {
                                    status: l12 as u16,
                                    version: HttpVersion::_lift(l13 as u8),
                                    headers: result22,
                                    body: _rt::Vec::from_raw_parts(l23.cast(), len25, len25),
                                }
                            };
                            Ok(e)
                        }
                        1 => {
                            let e = {
                                let l26 = i32::from(*base.add(4).cast::<u8>());
                                let v33 = match l26 {
                                    0 => HttpError::Timeout,
                                    1 => {
                                        let e33 = {
                                            let l27 = *base.add(8).cast::<*mut u8>();
                                            let l28 = *base.add(12).cast::<usize>();
                                            let len29 = l28;
                                            let bytes29 = _rt::Vec::from_raw_parts(
                                                l27.cast(),
                                                len29,
                                                len29,
                                            );
                                            _rt::string_lift(bytes29)
                                        };
                                        HttpError::Request(e33)
                                    }
                                    n => {
                                        debug_assert_eq!(n, 2, "invalid enum discriminant");
                                        let e33 = {
                                            let l30 = *base.add(8).cast::<*mut u8>();
                                            let l31 = *base.add(12).cast::<usize>();
                                            let len32 = l31;
                                            let bytes32 = _rt::Vec::from_raw_parts(
                                                l30.cast(),
                                                len32,
                                                len32,
                                            );
                                            _rt::string_lift(bytes32)
                                        };
                                        HttpError::Connect(e33)
                                    }
                                };
                                v33
                            };
                            Err(e)
                        }
                        _ => _rt::invalid_enum_discriminant(),
                    }
                };
                result34.push(e34);
            }
            _rt::cabi_dealloc(base34, len34 * 24, 4);
            if layout7.size() != 0 {
                _rt::alloc::dealloc(result7.cast(), layout7);
            }
            for (ptr, layout) in cleanup_list {
                if layout.size() != 0 {
                    _rt::alloc::dealloc(ptr.cast(), layout);
                }
            }
            result34
        }
    }
}
impl AccessLog {
    #[allow(unused_unsafe, clippy::all)]
    /// Sends the data to the access log.
    pub fn send(data: &[u8]) -> Result<(), LogError> {
        unsafe {
            #[repr(align(4))]
            struct RetArea([::core::mem::MaybeUninit<u8>; 16]);
            let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]);
            let vec0 = data;
            let ptr0 = vec0.as_ptr().cast::<u8>();
            let len0 = vec0.len();
            let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
            #[cfg(target_arch = "wasm32")]
            #[link(wasm_import_module = "$root")]
            extern "C" {
                #[link_name = "[static]access-log.send"]
                fn wit_import(_: *mut u8, _: usize, _: *mut u8);
            }
            #[cfg(not(target_arch = "wasm32"))]
            fn wit_import(_: *mut u8, _: usize, _: *mut u8) {
                unreachable!()
            }
            wit_import(ptr0.cast_mut(), len0, ptr1);
            let l2 = i32::from(*ptr1.add(0).cast::<u8>());
            match l2 {
                0 => {
                    let e = ();
                    Ok(e)
                }
                1 => {
                    let e = {
                        let l3 = i32::from(*ptr1.add(4).cast::<u8>());
                        let v7 = match l3 {
                            0 => {
                                let e7 = {
                                    let l4 = *ptr1.add(8).cast::<*mut u8>();
                                    let l5 = *ptr1.add(12).cast::<usize>();
                                    let len6 = l5;
                                    _rt::Vec::from_raw_parts(l4.cast(), len6, len6)
                                };
                                LogError::ChannelFull(e7)
                            }
                            n => {
                                debug_assert_eq!(n, 1, "invalid enum discriminant");
                                LogError::ChannelClosed
                            }
                        };
                        v7
                    };
                    Err(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            }
        }
    }
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_on_gateway_request_cabi<T: Guest>(
    arg0: i32,
    arg1: i32,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let result0 = T::on_gateway_request(
        Context::from_handle(arg0 as u32),
        Headers::from_handle(arg1 as u32),
    );
    let ptr1 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    match result0 {
        Ok(_) => {
            *ptr1.add(0).cast::<u8>() = (0i32) as u8;
        }
        Err(e) => {
            *ptr1.add(0).cast::<u8>() = (1i32) as u8;
            let ErrorResponse { status_code: status_code2, errors: errors2 } = e;
            *ptr1.add(4).cast::<u16>() = (_rt::as_i32(status_code2)) as u16;
            let vec9 = errors2;
            let len9 = vec9.len();
            let layout9 = _rt::alloc::Layout::from_size_align_unchecked(
                vec9.len() * 16,
                4,
            );
            let result9 = if layout9.size() != 0 {
                let ptr = _rt::alloc::alloc(layout9).cast::<u8>();
                if ptr.is_null() {
                    _rt::alloc::handle_alloc_error(layout9);
                }
                ptr
            } else {
                ::core::ptr::null_mut()
            };
            for (i, e) in vec9.into_iter().enumerate() {
                let base = result9.add(i * 16);
                {
                    let Error { extensions: extensions3, message: message3 } = e;
                    let vec7 = extensions3;
                    let len7 = vec7.len();
                    let layout7 = _rt::alloc::Layout::from_size_align_unchecked(
                        vec7.len() * 16,
                        4,
                    );
                    let result7 = if layout7.size() != 0 {
                        let ptr = _rt::alloc::alloc(layout7).cast::<u8>();
                        if ptr.is_null() {
                            _rt::alloc::handle_alloc_error(layout7);
                        }
                        ptr
                    } else {
                        ::core::ptr::null_mut()
                    };
                    for (i, e) in vec7.into_iter().enumerate() {
                        let base = result7.add(i * 16);
                        {
                            let (t4_0, t4_1) = e;
                            let vec5 = (t4_0.into_bytes()).into_boxed_slice();
                            let ptr5 = vec5.as_ptr().cast::<u8>();
                            let len5 = vec5.len();
                            ::core::mem::forget(vec5);
                            *base.add(4).cast::<usize>() = len5;
                            *base.add(0).cast::<*mut u8>() = ptr5.cast_mut();
                            let vec6 = (t4_1.into_bytes()).into_boxed_slice();
                            let ptr6 = vec6.as_ptr().cast::<u8>();
                            let len6 = vec6.len();
                            ::core::mem::forget(vec6);
                            *base.add(12).cast::<usize>() = len6;
                            *base.add(8).cast::<*mut u8>() = ptr6.cast_mut();
                        }
                    }
                    *base.add(4).cast::<usize>() = len7;
                    *base.add(0).cast::<*mut u8>() = result7;
                    let vec8 = (message3.into_bytes()).into_boxed_slice();
                    let ptr8 = vec8.as_ptr().cast::<u8>();
                    let len8 = vec8.len();
                    ::core::mem::forget(vec8);
                    *base.add(12).cast::<usize>() = len8;
                    *base.add(8).cast::<*mut u8>() = ptr8.cast_mut();
                }
            }
            *ptr1.add(12).cast::<usize>() = len9;
            *ptr1.add(8).cast::<*mut u8>() = result9;
        }
    };
    ptr1
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_on_gateway_request<T: Guest>(arg0: *mut u8) {
    let l0 = i32::from(*arg0.add(0).cast::<u8>());
    match l0 {
        0 => {}
        _ => {
            let l1 = *arg0.add(8).cast::<*mut u8>();
            let l2 = *arg0.add(12).cast::<usize>();
            let base12 = l1;
            let len12 = l2;
            for i in 0..len12 {
                let base = base12.add(i * 16);
                {
                    let l3 = *base.add(0).cast::<*mut u8>();
                    let l4 = *base.add(4).cast::<usize>();
                    let base9 = l3;
                    let len9 = l4;
                    for i in 0..len9 {
                        let base = base9.add(i * 16);
                        {
                            let l5 = *base.add(0).cast::<*mut u8>();
                            let l6 = *base.add(4).cast::<usize>();
                            _rt::cabi_dealloc(l5, l6, 1);
                            let l7 = *base.add(8).cast::<*mut u8>();
                            let l8 = *base.add(12).cast::<usize>();
                            _rt::cabi_dealloc(l7, l8, 1);
                        }
                    }
                    _rt::cabi_dealloc(base9, len9 * 16, 4);
                    let l10 = *base.add(8).cast::<*mut u8>();
                    let l11 = *base.add(12).cast::<usize>();
                    _rt::cabi_dealloc(l10, l11, 1);
                }
            }
            _rt::cabi_dealloc(base12, len12 * 16, 4);
        }
    }
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_on_subgraph_request_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: i32,
    arg4: *mut u8,
    arg5: usize,
    arg6: i32,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg5;
    let bytes1 = _rt::Vec::from_raw_parts(arg4.cast(), len1, len1);
    let result2 = T::on_subgraph_request(
        SharedContext::from_handle(arg0 as u32),
        _rt::string_lift(bytes0),
        HttpMethod::_lift(arg3 as u8),
        _rt::string_lift(bytes1),
        Headers::from_handle(arg6 as u32),
    );
    let ptr3 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    match result2 {
        Ok(_) => {
            *ptr3.add(0).cast::<u8>() = (0i32) as u8;
        }
        Err(e) => {
            *ptr3.add(0).cast::<u8>() = (1i32) as u8;
            let Error { extensions: extensions4, message: message4 } = e;
            let vec8 = extensions4;
            let len8 = vec8.len();
            let layout8 = _rt::alloc::Layout::from_size_align_unchecked(
                vec8.len() * 16,
                4,
            );
            let result8 = if layout8.size() != 0 {
                let ptr = _rt::alloc::alloc(layout8).cast::<u8>();
                if ptr.is_null() {
                    _rt::alloc::handle_alloc_error(layout8);
                }
                ptr
            } else {
                ::core::ptr::null_mut()
            };
            for (i, e) in vec8.into_iter().enumerate() {
                let base = result8.add(i * 16);
                {
                    let (t5_0, t5_1) = e;
                    let vec6 = (t5_0.into_bytes()).into_boxed_slice();
                    let ptr6 = vec6.as_ptr().cast::<u8>();
                    let len6 = vec6.len();
                    ::core::mem::forget(vec6);
                    *base.add(4).cast::<usize>() = len6;
                    *base.add(0).cast::<*mut u8>() = ptr6.cast_mut();
                    let vec7 = (t5_1.into_bytes()).into_boxed_slice();
                    let ptr7 = vec7.as_ptr().cast::<u8>();
                    let len7 = vec7.len();
                    ::core::mem::forget(vec7);
                    *base.add(12).cast::<usize>() = len7;
                    *base.add(8).cast::<*mut u8>() = ptr7.cast_mut();
                }
            }
            *ptr3.add(8).cast::<usize>() = len8;
            *ptr3.add(4).cast::<*mut u8>() = result8;
            let vec9 = (message4.into_bytes()).into_boxed_slice();
            let ptr9 = vec9.as_ptr().cast::<u8>();
            let len9 = vec9.len();
            ::core::mem::forget(vec9);
            *ptr3.add(16).cast::<usize>() = len9;
            *ptr3.add(12).cast::<*mut u8>() = ptr9.cast_mut();
        }
    };
    ptr3
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_on_subgraph_request<T: Guest>(arg0: *mut u8) {
    let l0 = i32::from(*arg0.add(0).cast::<u8>());
    match l0 {
        0 => {}
        _ => {
            let l1 = *arg0.add(4).cast::<*mut u8>();
            let l2 = *arg0.add(8).cast::<usize>();
            let base7 = l1;
            let len7 = l2;
            for i in 0..len7 {
                let base = base7.add(i * 16);
                {
                    let l3 = *base.add(0).cast::<*mut u8>();
                    let l4 = *base.add(4).cast::<usize>();
                    _rt::cabi_dealloc(l3, l4, 1);
                    let l5 = *base.add(8).cast::<*mut u8>();
                    let l6 = *base.add(12).cast::<usize>();
                    _rt::cabi_dealloc(l5, l6, 1);
                }
            }
            _rt::cabi_dealloc(base7, len7 * 16, 4);
            let l8 = *arg0.add(12).cast::<*mut u8>();
            let l9 = *arg0.add(16).cast::<usize>();
            _rt::cabi_dealloc(l8, l9, 1);
        }
    }
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_authorize_edge_pre_execution_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
    arg5: *mut u8,
    arg6: usize,
    arg7: *mut u8,
    arg8: usize,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let len2 = arg6;
    let bytes2 = _rt::Vec::from_raw_parts(arg5.cast(), len2, len2);
    let len3 = arg8;
    let bytes3 = _rt::Vec::from_raw_parts(arg7.cast(), len3, len3);
    let result4 = T::authorize_edge_pre_execution(
        SharedContext::from_handle(arg0 as u32),
        EdgeDefinition {
            parent_type_name: _rt::string_lift(bytes0),
            field_name: _rt::string_lift(bytes1),
        },
        _rt::string_lift(bytes2),
        _rt::string_lift(bytes3),
    );
    let ptr5 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    match result4 {
        Ok(_) => {
            *ptr5.add(0).cast::<u8>() = (0i32) as u8;
        }
        Err(e) => {
            *ptr5.add(0).cast::<u8>() = (1i32) as u8;
            let Error { extensions: extensions6, message: message6 } = e;
            let vec10 = extensions6;
            let len10 = vec10.len();
            let layout10 = _rt::alloc::Layout::from_size_align_unchecked(
                vec10.len() * 16,
                4,
            );
            let result10 = if layout10.size() != 0 {
                let ptr = _rt::alloc::alloc(layout10).cast::<u8>();
                if ptr.is_null() {
                    _rt::alloc::handle_alloc_error(layout10);
                }
                ptr
            } else {
                ::core::ptr::null_mut()
            };
            for (i, e) in vec10.into_iter().enumerate() {
                let base = result10.add(i * 16);
                {
                    let (t7_0, t7_1) = e;
                    let vec8 = (t7_0.into_bytes()).into_boxed_slice();
                    let ptr8 = vec8.as_ptr().cast::<u8>();
                    let len8 = vec8.len();
                    ::core::mem::forget(vec8);
                    *base.add(4).cast::<usize>() = len8;
                    *base.add(0).cast::<*mut u8>() = ptr8.cast_mut();
                    let vec9 = (t7_1.into_bytes()).into_boxed_slice();
                    let ptr9 = vec9.as_ptr().cast::<u8>();
                    let len9 = vec9.len();
                    ::core::mem::forget(vec9);
                    *base.add(12).cast::<usize>() = len9;
                    *base.add(8).cast::<*mut u8>() = ptr9.cast_mut();
                }
            }
            *ptr5.add(8).cast::<usize>() = len10;
            *ptr5.add(4).cast::<*mut u8>() = result10;
            let vec11 = (message6.into_bytes()).into_boxed_slice();
            let ptr11 = vec11.as_ptr().cast::<u8>();
            let len11 = vec11.len();
            ::core::mem::forget(vec11);
            *ptr5.add(16).cast::<usize>() = len11;
            *ptr5.add(12).cast::<*mut u8>() = ptr11.cast_mut();
        }
    };
    ptr5
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_authorize_edge_pre_execution<T: Guest>(arg0: *mut u8) {
    let l0 = i32::from(*arg0.add(0).cast::<u8>());
    match l0 {
        0 => {}
        _ => {
            let l1 = *arg0.add(4).cast::<*mut u8>();
            let l2 = *arg0.add(8).cast::<usize>();
            let base7 = l1;
            let len7 = l2;
            for i in 0..len7 {
                let base = base7.add(i * 16);
                {
                    let l3 = *base.add(0).cast::<*mut u8>();
                    let l4 = *base.add(4).cast::<usize>();
                    _rt::cabi_dealloc(l3, l4, 1);
                    let l5 = *base.add(8).cast::<*mut u8>();
                    let l6 = *base.add(12).cast::<usize>();
                    _rt::cabi_dealloc(l5, l6, 1);
                }
            }
            _rt::cabi_dealloc(base7, len7 * 16, 4);
            let l8 = *arg0.add(12).cast::<*mut u8>();
            let l9 = *arg0.add(16).cast::<usize>();
            _rt::cabi_dealloc(l8, l9, 1);
        }
    }
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_authorize_node_pre_execution_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let result2 = T::authorize_node_pre_execution(
        SharedContext::from_handle(arg0 as u32),
        NodeDefinition {
            type_name: _rt::string_lift(bytes0),
        },
        _rt::string_lift(bytes1),
    );
    let ptr3 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    match result2 {
        Ok(_) => {
            *ptr3.add(0).cast::<u8>() = (0i32) as u8;
        }
        Err(e) => {
            *ptr3.add(0).cast::<u8>() = (1i32) as u8;
            let Error { extensions: extensions4, message: message4 } = e;
            let vec8 = extensions4;
            let len8 = vec8.len();
            let layout8 = _rt::alloc::Layout::from_size_align_unchecked(
                vec8.len() * 16,
                4,
            );
            let result8 = if layout8.size() != 0 {
                let ptr = _rt::alloc::alloc(layout8).cast::<u8>();
                if ptr.is_null() {
                    _rt::alloc::handle_alloc_error(layout8);
                }
                ptr
            } else {
                ::core::ptr::null_mut()
            };
            for (i, e) in vec8.into_iter().enumerate() {
                let base = result8.add(i * 16);
                {
                    let (t5_0, t5_1) = e;
                    let vec6 = (t5_0.into_bytes()).into_boxed_slice();
                    let ptr6 = vec6.as_ptr().cast::<u8>();
                    let len6 = vec6.len();
                    ::core::mem::forget(vec6);
                    *base.add(4).cast::<usize>() = len6;
                    *base.add(0).cast::<*mut u8>() = ptr6.cast_mut();
                    let vec7 = (t5_1.into_bytes()).into_boxed_slice();
                    let ptr7 = vec7.as_ptr().cast::<u8>();
                    let len7 = vec7.len();
                    ::core::mem::forget(vec7);
                    *base.add(12).cast::<usize>() = len7;
                    *base.add(8).cast::<*mut u8>() = ptr7.cast_mut();
                }
            }
            *ptr3.add(8).cast::<usize>() = len8;
            *ptr3.add(4).cast::<*mut u8>() = result8;
            let vec9 = (message4.into_bytes()).into_boxed_slice();
            let ptr9 = vec9.as_ptr().cast::<u8>();
            let len9 = vec9.len();
            ::core::mem::forget(vec9);
            *ptr3.add(16).cast::<usize>() = len9;
            *ptr3.add(12).cast::<*mut u8>() = ptr9.cast_mut();
        }
    };
    ptr3
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_authorize_node_pre_execution<T: Guest>(arg0: *mut u8) {
    let l0 = i32::from(*arg0.add(0).cast::<u8>());
    match l0 {
        0 => {}
        _ => {
            let l1 = *arg0.add(4).cast::<*mut u8>();
            let l2 = *arg0.add(8).cast::<usize>();
            let base7 = l1;
            let len7 = l2;
            for i in 0..len7 {
                let base = base7.add(i * 16);
                {
                    let l3 = *base.add(0).cast::<*mut u8>();
                    let l4 = *base.add(4).cast::<usize>();
                    _rt::cabi_dealloc(l3, l4, 1);
                    let l5 = *base.add(8).cast::<*mut u8>();
                    let l6 = *base.add(12).cast::<usize>();
                    _rt::cabi_dealloc(l5, l6, 1);
                }
            }
            _rt::cabi_dealloc(base7, len7 * 16, 4);
            let l8 = *arg0.add(12).cast::<*mut u8>();
            let l9 = *arg0.add(16).cast::<usize>();
            _rt::cabi_dealloc(l8, l9, 1);
        }
    }
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_authorize_parent_edge_post_execution_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
    arg5: *mut u8,
    arg6: usize,
    arg7: *mut u8,
    arg8: usize,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let base5 = arg5;
    let len5 = arg6;
    let mut result5 = _rt::Vec::with_capacity(len5);
    for i in 0..len5 {
        let base = base5.add(i * 8);
        let e5 = {
            let l2 = *base.add(0).cast::<*mut u8>();
            let l3 = *base.add(4).cast::<usize>();
            let len4 = l3;
            let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
            _rt::string_lift(bytes4)
        };
        result5.push(e5);
    }
    _rt::cabi_dealloc(base5, len5 * 8, 4);
    let len6 = arg8;
    let bytes6 = _rt::Vec::from_raw_parts(arg7.cast(), len6, len6);
    let result7 = T::authorize_parent_edge_post_execution(
        SharedContext::from_handle(arg0 as u32),
        EdgeDefinition {
            parent_type_name: _rt::string_lift(bytes0),
            field_name: _rt::string_lift(bytes1),
        },
        result5,
        _rt::string_lift(bytes6),
    );
    let ptr8 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    let vec15 = result7;
    let len15 = vec15.len();
    let layout15 = _rt::alloc::Layout::from_size_align_unchecked(vec15.len() * 20, 4);
    let result15 = if layout15.size() != 0 {
        let ptr = _rt::alloc::alloc(layout15).cast::<u8>();
        if ptr.is_null() {
            _rt::alloc::handle_alloc_error(layout15);
        }
        ptr
    } else {
        ::core::ptr::null_mut()
    };
    for (i, e) in vec15.into_iter().enumerate() {
        let base = result15.add(i * 20);
        {
            match e {
                Ok(_) => {
                    *base.add(0).cast::<u8>() = (0i32) as u8;
                }
                Err(e) => {
                    *base.add(0).cast::<u8>() = (1i32) as u8;
                    let Error { extensions: extensions9, message: message9 } = e;
                    let vec13 = extensions9;
                    let len13 = vec13.len();
                    let layout13 = _rt::alloc::Layout::from_size_align_unchecked(
                        vec13.len() * 16,
                        4,
                    );
                    let result13 = if layout13.size() != 0 {
                        let ptr = _rt::alloc::alloc(layout13).cast::<u8>();
                        if ptr.is_null() {
                            _rt::alloc::handle_alloc_error(layout13);
                        }
                        ptr
                    } else {
                        ::core::ptr::null_mut()
                    };
                    for (i, e) in vec13.into_iter().enumerate() {
                        let base = result13.add(i * 16);
                        {
                            let (t10_0, t10_1) = e;
                            let vec11 = (t10_0.into_bytes()).into_boxed_slice();
                            let ptr11 = vec11.as_ptr().cast::<u8>();
                            let len11 = vec11.len();
                            ::core::mem::forget(vec11);
                            *base.add(4).cast::<usize>() = len11;
                            *base.add(0).cast::<*mut u8>() = ptr11.cast_mut();
                            let vec12 = (t10_1.into_bytes()).into_boxed_slice();
                            let ptr12 = vec12.as_ptr().cast::<u8>();
                            let len12 = vec12.len();
                            ::core::mem::forget(vec12);
                            *base.add(12).cast::<usize>() = len12;
                            *base.add(8).cast::<*mut u8>() = ptr12.cast_mut();
                        }
                    }
                    *base.add(8).cast::<usize>() = len13;
                    *base.add(4).cast::<*mut u8>() = result13;
                    let vec14 = (message9.into_bytes()).into_boxed_slice();
                    let ptr14 = vec14.as_ptr().cast::<u8>();
                    let len14 = vec14.len();
                    ::core::mem::forget(vec14);
                    *base.add(16).cast::<usize>() = len14;
                    *base.add(12).cast::<*mut u8>() = ptr14.cast_mut();
                }
            };
        }
    }
    *ptr8.add(4).cast::<usize>() = len15;
    *ptr8.add(0).cast::<*mut u8>() = result15;
    ptr8
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_authorize_parent_edge_post_execution<T: Guest>(
    arg0: *mut u8,
) {
    let l0 = *arg0.add(0).cast::<*mut u8>();
    let l1 = *arg0.add(4).cast::<usize>();
    let base12 = l0;
    let len12 = l1;
    for i in 0..len12 {
        let base = base12.add(i * 20);
        {
            let l2 = i32::from(*base.add(0).cast::<u8>());
            match l2 {
                0 => {}
                _ => {
                    let l3 = *base.add(4).cast::<*mut u8>();
                    let l4 = *base.add(8).cast::<usize>();
                    let base9 = l3;
                    let len9 = l4;
                    for i in 0..len9 {
                        let base = base9.add(i * 16);
                        {
                            let l5 = *base.add(0).cast::<*mut u8>();
                            let l6 = *base.add(4).cast::<usize>();
                            _rt::cabi_dealloc(l5, l6, 1);
                            let l7 = *base.add(8).cast::<*mut u8>();
                            let l8 = *base.add(12).cast::<usize>();
                            _rt::cabi_dealloc(l7, l8, 1);
                        }
                    }
                    _rt::cabi_dealloc(base9, len9 * 16, 4);
                    let l10 = *base.add(12).cast::<*mut u8>();
                    let l11 = *base.add(16).cast::<usize>();
                    _rt::cabi_dealloc(l10, l11, 1);
                }
            }
        }
    }
    _rt::cabi_dealloc(base12, len12 * 20, 4);
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_authorize_edge_node_post_execution_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
    arg5: *mut u8,
    arg6: usize,
    arg7: *mut u8,
    arg8: usize,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let base5 = arg5;
    let len5 = arg6;
    let mut result5 = _rt::Vec::with_capacity(len5);
    for i in 0..len5 {
        let base = base5.add(i * 8);
        let e5 = {
            let l2 = *base.add(0).cast::<*mut u8>();
            let l3 = *base.add(4).cast::<usize>();
            let len4 = l3;
            let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
            _rt::string_lift(bytes4)
        };
        result5.push(e5);
    }
    _rt::cabi_dealloc(base5, len5 * 8, 4);
    let len6 = arg8;
    let bytes6 = _rt::Vec::from_raw_parts(arg7.cast(), len6, len6);
    let result7 = T::authorize_edge_node_post_execution(
        SharedContext::from_handle(arg0 as u32),
        EdgeDefinition {
            parent_type_name: _rt::string_lift(bytes0),
            field_name: _rt::string_lift(bytes1),
        },
        result5,
        _rt::string_lift(bytes6),
    );
    let ptr8 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    let vec15 = result7;
    let len15 = vec15.len();
    let layout15 = _rt::alloc::Layout::from_size_align_unchecked(vec15.len() * 20, 4);
    let result15 = if layout15.size() != 0 {
        let ptr = _rt::alloc::alloc(layout15).cast::<u8>();
        if ptr.is_null() {
            _rt::alloc::handle_alloc_error(layout15);
        }
        ptr
    } else {
        ::core::ptr::null_mut()
    };
    for (i, e) in vec15.into_iter().enumerate() {
        let base = result15.add(i * 20);
        {
            match e {
                Ok(_) => {
                    *base.add(0).cast::<u8>() = (0i32) as u8;
                }
                Err(e) => {
                    *base.add(0).cast::<u8>() = (1i32) as u8;
                    let Error { extensions: extensions9, message: message9 } = e;
                    let vec13 = extensions9;
                    let len13 = vec13.len();
                    let layout13 = _rt::alloc::Layout::from_size_align_unchecked(
                        vec13.len() * 16,
                        4,
                    );
                    let result13 = if layout13.size() != 0 {
                        let ptr = _rt::alloc::alloc(layout13).cast::<u8>();
                        if ptr.is_null() {
                            _rt::alloc::handle_alloc_error(layout13);
                        }
                        ptr
                    } else {
                        ::core::ptr::null_mut()
                    };
                    for (i, e) in vec13.into_iter().enumerate() {
                        let base = result13.add(i * 16);
                        {
                            let (t10_0, t10_1) = e;
                            let vec11 = (t10_0.into_bytes()).into_boxed_slice();
                            let ptr11 = vec11.as_ptr().cast::<u8>();
                            let len11 = vec11.len();
                            ::core::mem::forget(vec11);
                            *base.add(4).cast::<usize>() = len11;
                            *base.add(0).cast::<*mut u8>() = ptr11.cast_mut();
                            let vec12 = (t10_1.into_bytes()).into_boxed_slice();
                            let ptr12 = vec12.as_ptr().cast::<u8>();
                            let len12 = vec12.len();
                            ::core::mem::forget(vec12);
                            *base.add(12).cast::<usize>() = len12;
                            *base.add(8).cast::<*mut u8>() = ptr12.cast_mut();
                        }
                    }
                    *base.add(8).cast::<usize>() = len13;
                    *base.add(4).cast::<*mut u8>() = result13;
                    let vec14 = (message9.into_bytes()).into_boxed_slice();
                    let ptr14 = vec14.as_ptr().cast::<u8>();
                    let len14 = vec14.len();
                    ::core::mem::forget(vec14);
                    *base.add(16).cast::<usize>() = len14;
                    *base.add(12).cast::<*mut u8>() = ptr14.cast_mut();
                }
            };
        }
    }
    *ptr8.add(4).cast::<usize>() = len15;
    *ptr8.add(0).cast::<*mut u8>() = result15;
    ptr8
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_authorize_edge_node_post_execution<T: Guest>(arg0: *mut u8) {
    let l0 = *arg0.add(0).cast::<*mut u8>();
    let l1 = *arg0.add(4).cast::<usize>();
    let base12 = l0;
    let len12 = l1;
    for i in 0..len12 {
        let base = base12.add(i * 20);
        {
            let l2 = i32::from(*base.add(0).cast::<u8>());
            match l2 {
                0 => {}
                _ => {
                    let l3 = *base.add(4).cast::<*mut u8>();
                    let l4 = *base.add(8).cast::<usize>();
                    let base9 = l3;
                    let len9 = l4;
                    for i in 0..len9 {
                        let base = base9.add(i * 16);
                        {
                            let l5 = *base.add(0).cast::<*mut u8>();
                            let l6 = *base.add(4).cast::<usize>();
                            _rt::cabi_dealloc(l5, l6, 1);
                            let l7 = *base.add(8).cast::<*mut u8>();
                            let l8 = *base.add(12).cast::<usize>();
                            _rt::cabi_dealloc(l7, l8, 1);
                        }
                    }
                    _rt::cabi_dealloc(base9, len9 * 16, 4);
                    let l10 = *base.add(12).cast::<*mut u8>();
                    let l11 = *base.add(16).cast::<usize>();
                    _rt::cabi_dealloc(l10, l11, 1);
                }
            }
        }
    }
    _rt::cabi_dealloc(base12, len12 * 20, 4);
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_authorize_edge_post_execution_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
    arg5: *mut u8,
    arg6: usize,
    arg7: *mut u8,
    arg8: usize,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let base11 = arg5;
    let len11 = arg6;
    let mut result11 = _rt::Vec::with_capacity(len11);
    for i in 0..len11 {
        let base = base11.add(i * 16);
        let e11 = {
            let l2 = *base.add(0).cast::<*mut u8>();
            let l3 = *base.add(4).cast::<usize>();
            let len4 = l3;
            let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
            let l5 = *base.add(8).cast::<*mut u8>();
            let l6 = *base.add(12).cast::<usize>();
            let base10 = l5;
            let len10 = l6;
            let mut result10 = _rt::Vec::with_capacity(len10);
            for i in 0..len10 {
                let base = base10.add(i * 8);
                let e10 = {
                    let l7 = *base.add(0).cast::<*mut u8>();
                    let l8 = *base.add(4).cast::<usize>();
                    let len9 = l8;
                    let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
                    _rt::string_lift(bytes9)
                };
                result10.push(e10);
            }
            _rt::cabi_dealloc(base10, len10 * 8, 4);
            (_rt::string_lift(bytes4), result10)
        };
        result11.push(e11);
    }
    _rt::cabi_dealloc(base11, len11 * 16, 4);
    let len12 = arg8;
    let bytes12 = _rt::Vec::from_raw_parts(arg7.cast(), len12, len12);
    let result13 = T::authorize_edge_post_execution(
        SharedContext::from_handle(arg0 as u32),
        EdgeDefinition {
            parent_type_name: _rt::string_lift(bytes0),
            field_name: _rt::string_lift(bytes1),
        },
        result11,
        _rt::string_lift(bytes12),
    );
    let ptr14 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    let vec21 = result13;
    let len21 = vec21.len();
    let layout21 = _rt::alloc::Layout::from_size_align_unchecked(vec21.len() * 20, 4);
    let result21 = if layout21.size() != 0 {
        let ptr = _rt::alloc::alloc(layout21).cast::<u8>();
        if ptr.is_null() {
            _rt::alloc::handle_alloc_error(layout21);
        }
        ptr
    } else {
        ::core::ptr::null_mut()
    };
    for (i, e) in vec21.into_iter().enumerate() {
        let base = result21.add(i * 20);
        {
            match e {
                Ok(_) => {
                    *base.add(0).cast::<u8>() = (0i32) as u8;
                }
                Err(e) => {
                    *base.add(0).cast::<u8>() = (1i32) as u8;
                    let Error { extensions: extensions15, message: message15 } = e;
                    let vec19 = extensions15;
                    let len19 = vec19.len();
                    let layout19 = _rt::alloc::Layout::from_size_align_unchecked(
                        vec19.len() * 16,
                        4,
                    );
                    let result19 = if layout19.size() != 0 {
                        let ptr = _rt::alloc::alloc(layout19).cast::<u8>();
                        if ptr.is_null() {
                            _rt::alloc::handle_alloc_error(layout19);
                        }
                        ptr
                    } else {
                        ::core::ptr::null_mut()
                    };
                    for (i, e) in vec19.into_iter().enumerate() {
                        let base = result19.add(i * 16);
                        {
                            let (t16_0, t16_1) = e;
                            let vec17 = (t16_0.into_bytes()).into_boxed_slice();
                            let ptr17 = vec17.as_ptr().cast::<u8>();
                            let len17 = vec17.len();
                            ::core::mem::forget(vec17);
                            *base.add(4).cast::<usize>() = len17;
                            *base.add(0).cast::<*mut u8>() = ptr17.cast_mut();
                            let vec18 = (t16_1.into_bytes()).into_boxed_slice();
                            let ptr18 = vec18.as_ptr().cast::<u8>();
                            let len18 = vec18.len();
                            ::core::mem::forget(vec18);
                            *base.add(12).cast::<usize>() = len18;
                            *base.add(8).cast::<*mut u8>() = ptr18.cast_mut();
                        }
                    }
                    *base.add(8).cast::<usize>() = len19;
                    *base.add(4).cast::<*mut u8>() = result19;
                    let vec20 = (message15.into_bytes()).into_boxed_slice();
                    let ptr20 = vec20.as_ptr().cast::<u8>();
                    let len20 = vec20.len();
                    ::core::mem::forget(vec20);
                    *base.add(16).cast::<usize>() = len20;
                    *base.add(12).cast::<*mut u8>() = ptr20.cast_mut();
                }
            };
        }
    }
    *ptr14.add(4).cast::<usize>() = len21;
    *ptr14.add(0).cast::<*mut u8>() = result21;
    ptr14
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_authorize_edge_post_execution<T: Guest>(arg0: *mut u8) {
    let l0 = *arg0.add(0).cast::<*mut u8>();
    let l1 = *arg0.add(4).cast::<usize>();
    let base12 = l0;
    let len12 = l1;
    for i in 0..len12 {
        let base = base12.add(i * 20);
        {
            let l2 = i32::from(*base.add(0).cast::<u8>());
            match l2 {
                0 => {}
                _ => {
                    let l3 = *base.add(4).cast::<*mut u8>();
                    let l4 = *base.add(8).cast::<usize>();
                    let base9 = l3;
                    let len9 = l4;
                    for i in 0..len9 {
                        let base = base9.add(i * 16);
                        {
                            let l5 = *base.add(0).cast::<*mut u8>();
                            let l6 = *base.add(4).cast::<usize>();
                            _rt::cabi_dealloc(l5, l6, 1);
                            let l7 = *base.add(8).cast::<*mut u8>();
                            let l8 = *base.add(12).cast::<usize>();
                            _rt::cabi_dealloc(l7, l8, 1);
                        }
                    }
                    _rt::cabi_dealloc(base9, len9 * 16, 4);
                    let l10 = *base.add(12).cast::<*mut u8>();
                    let l11 = *base.add(16).cast::<usize>();
                    _rt::cabi_dealloc(l10, l11, 1);
                }
            }
        }
    }
    _rt::cabi_dealloc(base12, len12 * 20, 4);
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_on_subgraph_response_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
    arg5: *mut u8,
    arg6: usize,
    arg7: *mut u8,
    arg8: usize,
    arg9: i32,
    arg10: i64,
    arg11: i32,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let len2 = arg6;
    let bytes2 = _rt::Vec::from_raw_parts(arg5.cast(), len2, len2);
    let base8 = arg7;
    let len8 = arg8;
    let mut result8 = _rt::Vec::with_capacity(len8);
    for i in 0..len8 {
        let base = base8.add(i * 32);
        let e8 = {
            let l3 = i32::from(*base.add(0).cast::<u8>());
            let v7 = match l3 {
                0 => SubgraphRequestExecutionKind::InternalServerError,
                1 => SubgraphRequestExecutionKind::HookError,
                2 => SubgraphRequestExecutionKind::RequestError,
                3 => SubgraphRequestExecutionKind::RateLimited,
                n => {
                    debug_assert_eq!(n, 4, "invalid enum discriminant");
                    let e7 = {
                        let l4 = *base.add(8).cast::<i64>();
                        let l5 = *base.add(16).cast::<i64>();
                        let l6 = i32::from(*base.add(24).cast::<u16>());
                        SubgraphResponse {
                            connection_time_ms: l4 as u64,
                            response_time_ms: l5 as u64,
                            status_code: l6 as u16,
                        }
                    };
                    SubgraphRequestExecutionKind::Response(e7)
                }
            };
            v7
        };
        result8.push(e8);
    }
    _rt::cabi_dealloc(base8, len8 * 32, 8);
    let result9 = T::on_subgraph_response(
        SharedContext::from_handle(arg0 as u32),
        ExecutedSubgraphRequest {
            subgraph_name: _rt::string_lift(bytes0),
            method: _rt::string_lift(bytes1),
            url: _rt::string_lift(bytes2),
            executions: result8,
            cache_status: CacheStatus::_lift(arg9 as u8),
            total_duration_ms: arg10 as u64,
            has_errors: _rt::bool_lift(arg11 as u8),
        },
    );
    let ptr10 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    let vec11 = (result9).into_boxed_slice();
    let ptr11 = vec11.as_ptr().cast::<u8>();
    let len11 = vec11.len();
    ::core::mem::forget(vec11);
    *ptr10.add(4).cast::<usize>() = len11;
    *ptr10.add(0).cast::<*mut u8>() = ptr11.cast_mut();
    ptr10
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_on_subgraph_response<T: Guest>(arg0: *mut u8) {
    let l0 = *arg0.add(0).cast::<*mut u8>();
    let l1 = *arg0.add(4).cast::<usize>();
    let base2 = l0;
    let len2 = l1;
    _rt::cabi_dealloc(base2, len2 * 1, 1);
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_on_operation_response_cabi<T: Guest>(
    arg0: i32,
    arg1: i32,
    arg2: *mut u8,
    arg3: usize,
    arg4: *mut u8,
    arg5: usize,
    arg6: i64,
    arg7: i32,
    arg8: i64,
    arg9: i32,
    arg10: i64,
    arg11: i32,
    arg12: *mut u8,
    arg13: usize,
) -> *mut u8 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len1 = arg5;
    let bytes1 = _rt::Vec::from_raw_parts(arg4.cast(), len1, len1);
    let v2 = match arg9 {
        0 => GraphqlResponseStatus::Success,
        1 => {
            let e2 = FieldError {
                count: arg10 as u64,
                data_is_null: _rt::bool_lift(arg11 as u8),
            };
            GraphqlResponseStatus::FieldError(e2)
        }
        2 => {
            let e2 = RequestError {
                count: arg10 as u64,
            };
            GraphqlResponseStatus::RequestError(e2)
        }
        n => {
            debug_assert_eq!(n, 3, "invalid enum discriminant");
            GraphqlResponseStatus::RefusedRequest
        }
    };
    let base6 = arg12;
    let len6 = arg13;
    let mut result6 = _rt::Vec::with_capacity(len6);
    for i in 0..len6 {
        let base = base6.add(i * 8);
        let e6 = {
            let l3 = *base.add(0).cast::<*mut u8>();
            let l4 = *base.add(4).cast::<usize>();
            let len5 = l4;
            _rt::Vec::from_raw_parts(l3.cast(), len5, len5)
        };
        result6.push(e6);
    }
    _rt::cabi_dealloc(base6, len6 * 8, 4);
    let result7 = T::on_operation_response(
        SharedContext::from_handle(arg0 as u32),
        ExecutedOperation {
            name: match arg1 {
                0 => None,
                1 => {
                    let e = {
                        let len0 = arg3;
                        let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0);
                        _rt::string_lift(bytes0)
                    };
                    Some(e)
                }
                _ => _rt::invalid_enum_discriminant(),
            },
            document: _rt::string_lift(bytes1),
            prepare_duration_ms: arg6 as u64,
            cached_plan: _rt::bool_lift(arg7 as u8),
            duration_ms: arg8 as u64,
            status: v2,
            on_subgraph_response_outputs: result6,
        },
    );
    let ptr8 = _RET_AREA.0.as_mut_ptr().cast::<u8>();
    let vec9 = (result7).into_boxed_slice();
    let ptr9 = vec9.as_ptr().cast::<u8>();
    let len9 = vec9.len();
    ::core::mem::forget(vec9);
    *ptr8.add(4).cast::<usize>() = len9;
    *ptr8.add(0).cast::<*mut u8>() = ptr9.cast_mut();
    ptr8
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn __post_return_on_operation_response<T: Guest>(arg0: *mut u8) {
    let l0 = *arg0.add(0).cast::<*mut u8>();
    let l1 = *arg0.add(4).cast::<usize>();
    let base2 = l0;
    let len2 = l1;
    _rt::cabi_dealloc(base2, len2 * 1, 1);
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_on_http_response_cabi<T: Guest>(
    arg0: i32,
    arg1: *mut u8,
    arg2: usize,
    arg3: *mut u8,
    arg4: usize,
    arg5: i32,
    arg6: *mut u8,
    arg7: usize,
) {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let len0 = arg2;
    let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0);
    let len1 = arg4;
    let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1);
    let base5 = arg6;
    let len5 = arg7;
    let mut result5 = _rt::Vec::with_capacity(len5);
    for i in 0..len5 {
        let base = base5.add(i * 8);
        let e5 = {
            let l2 = *base.add(0).cast::<*mut u8>();
            let l3 = *base.add(4).cast::<usize>();
            let len4 = l3;
            _rt::Vec::from_raw_parts(l2.cast(), len4, len4)
        };
        result5.push(e5);
    }
    _rt::cabi_dealloc(base5, len5 * 8, 4);
    T::on_http_response(
        SharedContext::from_handle(arg0 as u32),
        ExecutedHttpRequest {
            method: _rt::string_lift(bytes0),
            url: _rt::string_lift(bytes1),
            status_code: arg5 as u16,
            on_operation_response_outputs: result5,
        },
    );
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_init_hooks_cabi<T: Guest>() -> i64 {
    #[cfg(target_arch = "wasm32")] _rt::run_ctors_once();
    let result0 = T::init_hooks();
    _rt::as_i64(result0)
}
pub trait Guest {
    /// The hook is called in the federated gateway just before authentication. It can be used
    /// to read and modify the request headers. The context object is provided in a mutable form,
    /// allowing storage for the subsequent hooks to read.
    ///
    /// If returning an error from the hook, the request processing is stopped and the given error
    /// returned to the client.
    fn on_gateway_request(
        context: Context,
        headers: Headers,
    ) -> Result<(), ErrorResponse>;
    /// The hook is called just before requesting a subgraph, after rate limiting is done. It can be used
    /// to read and modify the subgraph request headers. If returning an error, the subgraph is not requested.
    fn on_subgraph_request(
        context: SharedContext,
        subgraph_name: _rt::String,
        method: HttpMethod,
        url: _rt::String,
        headers: Headers,
    ) -> Result<(), Error>;
    /// The hook is called in the request cycle if the schema defines an authorization directive on
    /// an edge, providing the arguments of the edge selected in the directive, the definition of the esge
    /// and the metadata of the directive to the hook.
    ///
    /// The hook is run before fetching any data.
    ///
    /// The result, if an error, will stop the request execution and return an error back to the user.
    /// Result of the edge will be null for an error response.
    fn authorize_edge_pre_execution(
        context: SharedContext,
        definition: EdgeDefinition,
        arguments: _rt::String,
        metadata: _rt::String,
    ) -> Result<(), Error>;
    /// The hook is called in the request cycle if the schema defines an authorization directive to
    /// a node, providing the definition of the node and the metadata of the directive to the hook.
    ///
    /// The hook is run before fetching any data.
    ///
    /// The result, if an error, will stop the request execution and return an error back to the user.
    /// Result of the edge will be null for an error response.
    fn authorize_node_pre_execution(
        context: SharedContext,
        definition: NodeDefinition,
        metadata: _rt::String,
    ) -> Result<(), Error>;
    /// The hook is called in the request cycle if the schema defines an authorization directive on
    /// an edge with the fields argument, providing fields from the parent node. The hook gets the
    /// parent type information, and a list of data with the defined fields of the parent for every
    /// child loaded by the parent query.
    ///
    /// The hook is run after fetching the data.
    ///
    /// The result can be one of the following:
    ///
    /// - A list of one item, which dictates the result for every child loaded from the edge
    /// - A list of many items, each one defining if the child should be shown or not
    ///
    /// Providing any other response will lead to the whole authorization hook failing and data not
    /// returned to the user.
    ///
    /// The list item can either be an empty Ok, which returns the edge data to the client. Or the
    /// item can be an error and the edge access is denied. The error data will be propagated to the
    /// response errors.
    fn authorize_parent_edge_post_execution(
        context: SharedContext,
        definition: EdgeDefinition,
        parents: _rt::Vec<_rt::String>,
        metadata: _rt::String,
    ) -> _rt::Vec<Result<(), Error>>;
    /// The hook is called in the request cycle if the schema defines an authorization directive on
    /// an edge with the node argument, providing fields from the child node. The hook gets the parent type information,
    /// and a list of data with the defined fields for every child loaded by the parent query.
    ///
    /// The hook is run after fetching the data.
    ///
    /// The result can be one of the following:
    ///
    /// - A list of one item, which dictates the result for every child loaded from the edge
    /// - A list of many items, each one defining if the child should be shown or not
    ///
    /// Providing any other response will lead to the whole authorization hook failing and data not
    /// returned to the user.
    ///
    /// The list item can either be an empty Ok, which returns the edge data to the client. Or the
    /// item can be an error and the edge access is denied. The error data will be propagated to the
    /// response errors.
    fn authorize_edge_node_post_execution(
        context: SharedContext,
        definition: EdgeDefinition,
        nodes: _rt::Vec<_rt::String>,
        metadata: _rt::String,
    ) -> _rt::Vec<Result<(), Error>>;
    /// The hook is called in the request cycle if the schema defines an authorization directive on
    /// an edge with the node and fields arguments, providing fields from the child node. The hook gets
    /// the parent type information, and a list of data with tuples of the parent data and a list of child data.
    ///
    /// The first part of the tuple is defined by the directive's fields argument and the second part by
    /// the node argument.
    ///
    /// The hook is run after fetching the data.
    ///
    /// The result can be one of the following:
    ///
    /// - A list of one item, which dictates the result for every child loaded from the edge
    /// - A list of many items, each one defining if the child should be shown or not
    ///
    /// Providing any other response will lead to the whole authorization hook failing and data not
    /// returned to the user.
    ///
    /// The list item can either be an empty Ok, which returns the edge data to the client. Or the
    /// item can be an error and the edge access is denied. The error data will be propagated to the
    /// response errors.
    fn authorize_edge_post_execution(
        context: SharedContext,
        definition: EdgeDefinition,
        edges: _rt::Vec<(_rt::String, _rt::Vec<_rt::String>)>,
        metadata: _rt::String,
    ) -> _rt::Vec<Result<(), Error>>;
    /// The hook is called after a subgraph entity has been either requested or fetched from cache.
    /// The output is a list of bytes, which will be available in the on-operation-response hook.
    fn on_subgraph_response(
        context: SharedContext,
        request: ExecutedSubgraphRequest,
    ) -> _rt::Vec<u8>;
    /// The hook is called after a request is handled in the gateway. The output is a list of bytes,
    /// which will be available in the on-http-response hook.
    fn on_operation_response(
        context: SharedContext,
        request: ExecutedOperation,
    ) -> _rt::Vec<u8>;
    /// The hook is called right before a response is sent to the user.
    fn on_http_response(context: SharedContext, request: ExecutedHttpRequest);
    /// The hooks initialization function. Must be called before any other hook function.
    fn init_hooks() -> i64;
}
#[doc(hidden)]
macro_rules! __export_world_hooks_cabi {
    ($ty:ident with_types_in $($path_to_types:tt)*) => {
        const _ : () = { #[export_name = "on-gateway-request"] unsafe extern "C" fn
        export_on_gateway_request(arg0 : i32, arg1 : i32,) -> * mut u8 {
        $($path_to_types)*:: _export_on_gateway_request_cabi::<$ty > (arg0, arg1) }
        #[export_name = "cabi_post_on-gateway-request"] unsafe extern "C" fn
        _post_return_on_gateway_request(arg0 : * mut u8,) { $($path_to_types)*::
        __post_return_on_gateway_request::<$ty > (arg0) } #[export_name =
        "on-subgraph-request"] unsafe extern "C" fn export_on_subgraph_request(arg0 :
        i32, arg1 : * mut u8, arg2 : usize, arg3 : i32, arg4 : * mut u8, arg5 : usize,
        arg6 : i32,) -> * mut u8 { $($path_to_types)*::
        _export_on_subgraph_request_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4, arg5,
        arg6) } #[export_name = "cabi_post_on-subgraph-request"] unsafe extern "C" fn
        _post_return_on_subgraph_request(arg0 : * mut u8,) { $($path_to_types)*::
        __post_return_on_subgraph_request::<$ty > (arg0) } #[export_name =
        "authorize-edge-pre-execution"] unsafe extern "C" fn
        export_authorize_edge_pre_execution(arg0 : i32, arg1 : * mut u8, arg2 : usize,
        arg3 : * mut u8, arg4 : usize, arg5 : * mut u8, arg6 : usize, arg7 : * mut u8,
        arg8 : usize,) -> * mut u8 { $($path_to_types)*::
        _export_authorize_edge_pre_execution_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4,
        arg5, arg6, arg7, arg8) } #[export_name =
        "cabi_post_authorize-edge-pre-execution"] unsafe extern "C" fn
        _post_return_authorize_edge_pre_execution(arg0 : * mut u8,) {
        $($path_to_types)*:: __post_return_authorize_edge_pre_execution::<$ty > (arg0) }
        #[export_name = "authorize-node-pre-execution"] unsafe extern "C" fn
        export_authorize_node_pre_execution(arg0 : i32, arg1 : * mut u8, arg2 : usize,
        arg3 : * mut u8, arg4 : usize,) -> * mut u8 { $($path_to_types)*::
        _export_authorize_node_pre_execution_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4)
        } #[export_name = "cabi_post_authorize-node-pre-execution"] unsafe extern "C" fn
        _post_return_authorize_node_pre_execution(arg0 : * mut u8,) {
        $($path_to_types)*:: __post_return_authorize_node_pre_execution::<$ty > (arg0) }
        #[export_name = "authorize-parent-edge-post-execution"] unsafe extern "C" fn
        export_authorize_parent_edge_post_execution(arg0 : i32, arg1 : * mut u8, arg2 :
        usize, arg3 : * mut u8, arg4 : usize, arg5 : * mut u8, arg6 : usize, arg7 : * mut
        u8, arg8 : usize,) -> * mut u8 { $($path_to_types)*::
        _export_authorize_parent_edge_post_execution_cabi::<$ty > (arg0, arg1, arg2,
        arg3, arg4, arg5, arg6, arg7, arg8) } #[export_name =
        "cabi_post_authorize-parent-edge-post-execution"] unsafe extern "C" fn
        _post_return_authorize_parent_edge_post_execution(arg0 : * mut u8,) {
        $($path_to_types)*:: __post_return_authorize_parent_edge_post_execution::<$ty >
        (arg0) } #[export_name = "authorize-edge-node-post-execution"] unsafe extern "C"
        fn export_authorize_edge_node_post_execution(arg0 : i32, arg1 : * mut u8, arg2 :
        usize, arg3 : * mut u8, arg4 : usize, arg5 : * mut u8, arg6 : usize, arg7 : * mut
        u8, arg8 : usize,) -> * mut u8 { $($path_to_types)*::
        _export_authorize_edge_node_post_execution_cabi::<$ty > (arg0, arg1, arg2, arg3,
        arg4, arg5, arg6, arg7, arg8) } #[export_name =
        "cabi_post_authorize-edge-node-post-execution"] unsafe extern "C" fn
        _post_return_authorize_edge_node_post_execution(arg0 : * mut u8,) {
        $($path_to_types)*:: __post_return_authorize_edge_node_post_execution::<$ty >
        (arg0) } #[export_name = "authorize-edge-post-execution"] unsafe extern "C" fn
        export_authorize_edge_post_execution(arg0 : i32, arg1 : * mut u8, arg2 : usize,
        arg3 : * mut u8, arg4 : usize, arg5 : * mut u8, arg6 : usize, arg7 : * mut u8,
        arg8 : usize,) -> * mut u8 { $($path_to_types)*::
        _export_authorize_edge_post_execution_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4,
        arg5, arg6, arg7, arg8) } #[export_name =
        "cabi_post_authorize-edge-post-execution"] unsafe extern "C" fn
        _post_return_authorize_edge_post_execution(arg0 : * mut u8,) {
        $($path_to_types)*:: __post_return_authorize_edge_post_execution::<$ty > (arg0) }
        #[export_name = "on-subgraph-response"] unsafe extern "C" fn
        export_on_subgraph_response(arg0 : i32, arg1 : * mut u8, arg2 : usize, arg3 : *
        mut u8, arg4 : usize, arg5 : * mut u8, arg6 : usize, arg7 : * mut u8, arg8 :
        usize, arg9 : i32, arg10 : i64, arg11 : i32,) -> * mut u8 { $($path_to_types)*::
        _export_on_subgraph_response_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4, arg5,
        arg6, arg7, arg8, arg9, arg10, arg11) } #[export_name =
        "cabi_post_on-subgraph-response"] unsafe extern "C" fn
        _post_return_on_subgraph_response(arg0 : * mut u8,) { $($path_to_types)*::
        __post_return_on_subgraph_response::<$ty > (arg0) } #[export_name =
        "on-operation-response"] unsafe extern "C" fn export_on_operation_response(arg0 :
        i32, arg1 : i32, arg2 : * mut u8, arg3 : usize, arg4 : * mut u8, arg5 : usize,
        arg6 : i64, arg7 : i32, arg8 : i64, arg9 : i32, arg10 : i64, arg11 : i32, arg12 :
        * mut u8, arg13 : usize,) -> * mut u8 { $($path_to_types)*::
        _export_on_operation_response_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4, arg5,
        arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) } #[export_name =
        "cabi_post_on-operation-response"] unsafe extern "C" fn
        _post_return_on_operation_response(arg0 : * mut u8,) { $($path_to_types)*::
        __post_return_on_operation_response::<$ty > (arg0) } #[export_name =
        "on-http-response"] unsafe extern "C" fn export_on_http_response(arg0 : i32, arg1
        : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize, arg5 : i32, arg6 : * mut
        u8, arg7 : usize,) { $($path_to_types)*:: _export_on_http_response_cabi::<$ty >
        (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) } #[export_name = "init-hooks"]
        unsafe extern "C" fn export_init_hooks() -> i64 { $($path_to_types)*::
        _export_init_hooks_cabi::<$ty > () } };
    };
}
#[doc(hidden)]
pub(crate) use __export_world_hooks_cabi;
#[repr(align(4))]
struct _RetArea([::core::mem::MaybeUninit<u8>; 20]);
static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 20]);
mod _rt {
    pub use alloc_crate::vec::Vec;
    use core::fmt;
    use core::marker;
    use core::sync::atomic::{AtomicU32, Ordering::Relaxed};
    /// A type which represents a component model resource, either imported or
    /// exported into this component.
    ///
    /// This is a low-level wrapper which handles the lifetime of the resource
    /// (namely this has a destructor). The `T` provided defines the component model
    /// intrinsics that this wrapper uses.
    ///
    /// One of the chief purposes of this type is to provide `Deref` implementations
    /// to access the underlying data when it is owned.
    ///
    /// This type is primarily used in generated code for exported and imported
    /// resources.
    #[repr(transparent)]
    pub struct Resource<T: WasmResource> {
        handle: AtomicU32,
        _marker: marker::PhantomData<T>,
    }
    /// A trait which all wasm resources implement, namely providing the ability to
    /// drop a resource.
    ///
    /// This generally is implemented by generated code, not user-facing code.
    #[allow(clippy::missing_safety_doc)]
    pub unsafe trait WasmResource {
        /// Invokes the `[resource-drop]...` intrinsic.
        unsafe fn drop(handle: u32);
    }
    impl<T: WasmResource> Resource<T> {
        #[doc(hidden)]
        pub unsafe fn from_handle(handle: u32) -> Self {
            debug_assert!(handle != u32::MAX);
            Self {
                handle: AtomicU32::new(handle),
                _marker: marker::PhantomData,
            }
        }
        /// Takes ownership of the handle owned by `resource`.
        ///
        /// Note that this ideally would be `into_handle` taking `Resource<T>` by
        /// ownership. The code generator does not enable that in all situations,
        /// unfortunately, so this is provided instead.
        ///
        /// Also note that `take_handle` is in theory only ever called on values
        /// owned by a generated function. For example a generated function might
        /// take `Resource<T>` as an argument but then call `take_handle` on a
        /// reference to that argument. In that sense the dynamic nature of
        /// `take_handle` should only be exposed internally to generated code, not
        /// to user code.
        #[doc(hidden)]
        pub fn take_handle(resource: &Resource<T>) -> u32 {
            resource.handle.swap(u32::MAX, Relaxed)
        }
        #[doc(hidden)]
        pub fn handle(resource: &Resource<T>) -> u32 {
            resource.handle.load(Relaxed)
        }
    }
    impl<T: WasmResource> fmt::Debug for Resource<T> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("Resource").field("handle", &self.handle).finish()
        }
    }
    impl<T: WasmResource> Drop for Resource<T> {
        fn drop(&mut self) {
            unsafe {
                match self.handle.load(Relaxed) {
                    u32::MAX => {}
                    other => T::drop(other),
                }
            }
        }
    }
    pub use alloc_crate::string::String;
    pub unsafe fn string_lift(bytes: Vec<u8>) -> String {
        if cfg!(debug_assertions) {
            String::from_utf8(bytes).unwrap()
        } else {
            String::from_utf8_unchecked(bytes)
        }
    }
    pub unsafe fn invalid_enum_discriminant<T>() -> T {
        if cfg!(debug_assertions) {
            panic!("invalid enum discriminant")
        } else {
            core::hint::unreachable_unchecked()
        }
    }
    pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) {
        if size == 0 {
            return;
        }
        let layout = alloc::Layout::from_size_align_unchecked(size, align);
        alloc::dealloc(ptr, layout);
    }
    pub use alloc_crate::alloc;
    pub fn as_i64<T: AsI64>(t: T) -> i64 {
        t.as_i64()
    }
    pub trait AsI64 {
        fn as_i64(self) -> i64;
    }
    impl<'a, T: Copy + AsI64> AsI64 for &'a T {
        fn as_i64(self) -> i64 {
            (*self).as_i64()
        }
    }
    impl AsI64 for i64 {
        #[inline]
        fn as_i64(self) -> i64 {
            self as i64
        }
    }
    impl AsI64 for u64 {
        #[inline]
        fn as_i64(self) -> i64 {
            self as i64
        }
    }
    #[cfg(target_arch = "wasm32")]
    pub fn run_ctors_once() {
        wit_bindgen_rt::run_ctors_once();
    }
    pub fn as_i32<T: AsI32>(t: T) -> i32 {
        t.as_i32()
    }
    pub trait AsI32 {
        fn as_i32(self) -> i32;
    }
    impl<'a, T: Copy + AsI32> AsI32 for &'a T {
        fn as_i32(self) -> i32 {
            (*self).as_i32()
        }
    }
    impl AsI32 for i32 {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for u32 {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for i16 {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for u16 {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for i8 {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for u8 {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for char {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    impl AsI32 for usize {
        #[inline]
        fn as_i32(self) -> i32 {
            self as i32
        }
    }
    pub unsafe fn bool_lift(val: u8) -> bool {
        if cfg!(debug_assertions) {
            match val {
                0 => false,
                1 => true,
                _ => panic!("invalid bool discriminant"),
            }
        } else {
            val != 0
        }
    }
    extern crate alloc as alloc_crate;
}
/// Generates `#[no_mangle]` functions to export the specified type as the
/// root implementation of all generated traits.
///
/// For more information see the documentation of `wit_bindgen::generate!`.
///
/// ```rust
/// # macro_rules! export{ ($($t:tt)*) => (); }
/// # trait Guest {}
/// struct MyType;
///
/// impl Guest for MyType {
///     // ...
/// }
///
/// export!(MyType);
/// ```
#[allow(unused_macros)]
#[doc(hidden)]
macro_rules! __export_hooks_impl {
    ($ty:ident) => {
        self::export!($ty with_types_in self);
    };
    ($ty:ident with_types_in $($path_to_types_root:tt)*) => {
        $($path_to_types_root)*:: __export_world_hooks_cabi!($ty with_types_in
        $($path_to_types_root)*);
    };
}
#[doc(inline)]
pub(crate) use __export_hooks_impl as export;
#[cfg(target_arch = "wasm32")]
#[link_section = "component-type:wit-bindgen:0.31.0:component:grafbase:hooks:encoded world"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2843] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x9f\x15\x01A\x02\x01\
Ar\x01m\x02\x14invalid-header-value\x13invalid-header-name\x03\0\x0cheader-error\
\x03\0\0\x01p}\x01q\x02\x0cchannel-full\x01\x02\0\x0echannel-closed\0\0\x03\0\x09\
log-error\x03\0\x03\x03\0\x07context\x03\x01\x03\0\x0eshared-context\x03\x01\x03\
\0\x07headers\x03\x01\x01r\x02\x10parent-type-names\x0afield-names\x03\0\x0fedge\
-definition\x03\0\x08\x01r\x01\x09type-names\x03\0\x0fnode-definition\x03\0\x0a\x01\
p\x02\x01r\x04\x06methods\x03urls\x0bstatus-code{\x1don-operation-response-outpu\
ts\x0c\x03\0\x15executed-http-request\x03\0\x0d\x01r\x02\x05countw\x0cdata-is-nu\
ll\x7f\x03\0\x0bfield-error\x03\0\x0f\x01r\x01\x05countw\x03\0\x0drequest-error\x03\
\0\x11\x01q\x04\x07success\0\0\x0bfield-error\x01\x10\0\x0drequest-error\x01\x12\
\0\x0frefused-request\0\0\x03\0\x17graphql-response-status\x03\0\x13\x01ks\x01r\x07\
\x04name\x15\x08documents\x13prepare-duration-msw\x0bcached-plan\x7f\x0bduration\
-msw\x06status\x14\x1con-subgraph-response-outputs\x0c\x03\0\x12executed-operati\
on\x03\0\x16\x01r\x03\x12connection-time-msw\x10response-time-msw\x0bstatus-code\
{\x03\0\x11subgraph-response\x03\0\x18\x01m\x03\x03hit\x0bpartial-hit\x04miss\x03\
\0\x0ccache-status\x03\0\x1a\x01q\x05\x15internal-server-error\0\0\x0ahook-error\
\0\0\x0drequest-error\0\0\x0crate-limited\0\0\x08response\x01\x19\0\x03\0\x1fsub\
graph-request-execution-kind\x03\0\x1c\x01p\x1d\x01r\x07\x0dsubgraph-names\x06me\
thods\x03urls\x0aexecutions\x1e\x0ccache-status\x1b\x11total-duration-msw\x0ahas\
-errors\x7f\x03\0\x19executed-subgraph-request\x03\0\x1f\x01o\x02ss\x01p!\x01r\x02\
\x0aextensions\"\x07messages\x03\0\x05error\x03\0#\x01p$\x01r\x02\x0bstatus-code\
{\x06errors%\x03\0\x0eerror-response\x03\0&\x03\0\x0bhttp-client\x03\x01\x03\0\x0a\
access-log\x03\x01\x01m\x09\x03get\x04post\x03put\x06delete\x05patch\x04head\x07\
options\x07connect\x05trace\x03\0\x0bhttp-method\x03\0*\x01kw\x01r\x05\x06method\
+\x03urls\x07headers\"\x04body\x02\x0atimeout-ms,\x03\0\x0chttp-request\x03\0-\x01\
m\x05\x06http09\x06http10\x06http11\x06http20\x06http30\x03\0\x0chttp-version\x03\
\0/\x01r\x04\x06status{\x07version0\x07headers\"\x04body\x02\x03\0\x0dhttp-respo\
nse\x03\01\x01q\x03\x07timeout\0\0\x07request\x01s\0\x07connect\x01s\0\x03\0\x0a\
http-error\x03\03\x01h\x05\x01@\x02\x04self5\x04names\0\x15\x03\0\x13[method]con\
text.get\x016\x01@\x03\x04self5\x04names\x05values\x01\0\x03\0\x13[method]contex\
t.set\x017\x03\0\x16[method]context.delete\x016\x01h\x06\x01@\x02\x04self8\x04na\
mes\0\x15\x03\0\x1a[method]shared-context.get\x019\x01@\x01\x04self8\0s\x03\0\x1f\
[method]shared-context.trace-id\x01:\x01h\x07\x01@\x02\x04self;\x04names\0\x15\x03\
\0\x13[method]headers.get\x01<\x01j\0\x01\x01\x01@\x03\x04self;\x04names\x05valu\
es\0=\x03\0\x13[method]headers.set\x01>\x03\0\x16[method]headers.delete\x01<\x01\
@\x01\x04self;\0\"\x03\0\x17[method]headers.entries\x01?\x01j\x012\x014\x01@\x01\
\x07request.\0\xc0\0\x03\0\x1b[static]http-client.execute\x01A\x01p.\x01p\xc0\0\x01\
@\x01\x08requests\xc2\0\0\xc3\0\x03\0\x20[static]http-client.execute-many\x01D\x01\
j\0\x01\x04\x01@\x01\x04data\x02\0\xc5\0\x03\0\x17[static]access-log.send\x01F\x01\
i\x05\x01i\x07\x01j\0\x01'\x01@\x02\x07context\xc7\0\x07headers\xc8\0\0\xc9\0\x04\
\0\x12on-gateway-request\x01J\x01i\x06\x01j\0\x01$\x01@\x05\x07context\xcb\0\x0d\
subgraph-names\x06method+\x03urls\x07headers\xc8\0\0\xcc\0\x04\0\x13on-subgraph-\
request\x01M\x01@\x04\x07context\xcb\0\x0adefinition\x09\x09argumentss\x08metada\
tas\0\xcc\0\x04\0\x1cauthorize-edge-pre-execution\x01N\x01@\x03\x07context\xcb\0\
\x0adefinition\x0b\x08metadatas\0\xcc\0\x04\0\x1cauthorize-node-pre-execution\x01\
O\x01ps\x01p\xcc\0\x01@\x04\x07context\xcb\0\x0adefinition\x09\x07parents\xd0\0\x08\
metadatas\0\xd1\0\x04\0$authorize-parent-edge-post-execution\x01R\x01@\x04\x07co\
ntext\xcb\0\x0adefinition\x09\x05nodes\xd0\0\x08metadatas\0\xd1\0\x04\0\"authori\
ze-edge-node-post-execution\x01S\x01o\x02s\xd0\0\x01p\xd4\0\x01@\x04\x07context\xcb\
\0\x0adefinition\x09\x05edges\xd5\0\x08metadatas\0\xd1\0\x04\0\x1dauthorize-edge\
-post-execution\x01V\x01@\x02\x07context\xcb\0\x07request\x20\0\x02\x04\0\x14on-\
subgraph-response\x01W\x01@\x02\x07context\xcb\0\x07request\x17\0\x02\x04\0\x15o\
n-operation-response\x01X\x01@\x02\x07context\xcb\0\x07request\x0e\x01\0\x04\0\x10\
on-http-response\x01Y\x01@\0\0x\x04\0\x0ainit-hooks\x01Z\x04\x01\x18component:gr\
afbase/hooks\x04\0\x0b\x0b\x01\0\x05hooks\x03\0\0\0G\x09producers\x01\x0cprocess\
ed-by\x02\x0dwit-component\x070.216.0\x10wit-bindgen-rust\x060.31.0";
#[inline(never)]
#[doc(hidden)]
pub fn __link_custom_section_describing_imports() {
    wit_bindgen_rt::maybe_link_cabi_realloc();
}