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
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
use std::mem::MaybeUninit;
use wasmer::{MemorySize, ValueType};
// TODO: Remove once bindings generate wai_bindgen_rust::bitflags::bitflags!  (temp hack)
use wai_bindgen_rust as wit_bindgen_rust;

use super::ExitCode;

#[doc = " Type names used by low-level WASI interfaces."]
#[doc = " An array size."]
#[doc = " "]
#[doc = " Note: This is similar to `size_t` in POSIX."]
pub type Size = u32;
#[doc = " Non-negative file size or length of a region within a file."]
pub type Filesize = u64;
#[doc = " Timestamp in nanoseconds."]
pub type Timestamp = u64;
#[doc = " A file descriptor handle."]
pub type Fd = u32;
#[doc = " A reference to the offset of a directory entry."]
pub type Dircookie = u64;
#[doc = " The type for the `dirent::d-namlen` field of `dirent` struct."]
pub type Dirnamlen = u32;
#[doc = " File serial number that is unique within its file system."]
pub type Inode = u64;
#[doc = " Identifier for a device containing a file system. Can be used in combination"]
#[doc = " with `inode` to uniquely identify a file or directory in the filesystem."]
pub type Device = u64;
pub type Linkcount = u64;
pub type Snapshot0Linkcount = u32;
pub type Tid = u32;
pub type Pid = u32;
#[doc = " Identifiers for clocks, snapshot0 version."]
#[repr(u32)]
#[derive(Clone, Copy, PartialEq, Eq, num_enum :: TryFromPrimitive, Hash)]
pub enum Snapshot0Clockid {
    #[doc = " The clock measuring real time. Time value zero corresponds with"]
    #[doc = " 1970-01-01T00:00:00Z."]
    Realtime,
    #[doc = " The store-wide monotonic clock, which is defined as a clock measuring"]
    #[doc = " real time, whose value cannot be adjusted and which cannot have negative"]
    #[doc = " clock jumps. The epoch of this clock is undefined. The absolute time"]
    #[doc = " value of this clock therefore has no meaning."]
    Monotonic,
    #[doc = " The CPU-time clock associated with the current process."]
    ProcessCputimeId,
    #[doc = " The CPU-time clock associated with the current thread."]
    ThreadCputimeId,
}
impl core::fmt::Debug for Snapshot0Clockid {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Snapshot0Clockid::Realtime => f.debug_tuple("Snapshot0Clockid::Realtime").finish(),
            Snapshot0Clockid::Monotonic => f.debug_tuple("Snapshot0Clockid::Monotonic").finish(),
            Snapshot0Clockid::ProcessCputimeId => {
                f.debug_tuple("Snapshot0Clockid::ProcessCputimeId").finish()
            }
            Snapshot0Clockid::ThreadCputimeId => {
                f.debug_tuple("Snapshot0Clockid::ThreadCputimeId").finish()
            }
        }
    }
}
#[doc = " Identifiers for clocks."]
#[repr(u32)]
#[derive(Clone, Copy, PartialEq, Eq, num_enum :: TryFromPrimitive, Hash)]
pub enum Clockid {
    #[doc = " The clock measuring real time. Time value zero corresponds with"]
    #[doc = " 1970-01-01T00:00:00Z."]
    Realtime,
    #[doc = " The store-wide monotonic clock, which is defined as a clock measuring"]
    #[doc = " real time, whose value cannot be adjusted and which cannot have negative"]
    #[doc = " clock jumps. The epoch of this clock is undefined. The absolute time"]
    #[doc = " value of this clock therefore has no meaning."]
    Monotonic,
    #[doc = " The CPU-time clock associated with the current process."]
    ProcessCputimeId,
    #[doc = " The CPU-time clock associated with the current thread."]
    ThreadCputimeId,
}
impl core::fmt::Debug for Clockid {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Clockid::Realtime => f.debug_tuple("Clockid::Realtime").finish(),
            Clockid::Monotonic => f.debug_tuple("Clockid::Monotonic").finish(),
            Clockid::ProcessCputimeId => f.debug_tuple("Clockid::ProcessCputimeId").finish(),
            Clockid::ThreadCputimeId => f.debug_tuple("Clockid::ThreadCputimeId").finish(),
        }
    }
}
#[doc = " Error codes returned by functions."]
#[doc = " Not all of these error codes are returned by the functions provided by this"]
#[doc = " API; some are used in higher-level library layers, and others are provided"]
#[doc = " merely for alignment with POSIX."]
#[repr(u16)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub enum Errno {
    #[doc = " No error occurred. System call completed successfully."]
    Success,
    #[doc = " Argument list too long."]
    Toobig,
    #[doc = " Permission denied."]
    Access,
    #[doc = " Address in use."]
    Addrinuse,
    #[doc = " Address not available."]
    Addrnotavail,
    #[doc = " Address family not supported."]
    Afnosupport,
    #[doc = " Resource unavailable, or operation would block."]
    Again,
    #[doc = " Connection already in progress."]
    Already,
    #[doc = " Bad file descriptor."]
    Badf,
    #[doc = " Bad message."]
    Badmsg,
    #[doc = " Device or resource busy."]
    Busy,
    #[doc = " Operation canceled."]
    Canceled,
    #[doc = " No child processes."]
    Child,
    #[doc = " Connection aborted."]
    Connaborted,
    #[doc = " Connection refused."]
    Connrefused,
    #[doc = " Connection reset."]
    Connreset,
    #[doc = " Resource deadlock would occur."]
    Deadlk,
    #[doc = " Destination address required."]
    Destaddrreq,
    #[doc = " Mathematics argument out of domain of function."]
    Dom,
    #[doc = " Reserved."]
    Dquot,
    #[doc = " File exists."]
    Exist,
    #[doc = " Bad address."]
    Fault,
    #[doc = " File too large."]
    Fbig,
    #[doc = " Host is unreachable."]
    Hostunreach,
    #[doc = " Identifier removed."]
    Idrm,
    #[doc = " Illegal byte sequence."]
    Ilseq,
    #[doc = " Operation in progress."]
    Inprogress,
    #[doc = " Interrupted function."]
    Intr,
    #[doc = " Invalid argument."]
    Inval,
    #[doc = " I/O error."]
    Io,
    #[doc = " Socket is connected."]
    Isconn,
    #[doc = " Is a directory."]
    Isdir,
    #[doc = " Too many levels of symbolic links."]
    Loop,
    #[doc = " File descriptor value too large."]
    Mfile,
    #[doc = " Too many links."]
    Mlink,
    #[doc = " Message too large."]
    Msgsize,
    #[doc = " Reserved."]
    Multihop,
    #[doc = " Filename too long."]
    Nametoolong,
    #[doc = " Network is down."]
    Netdown,
    #[doc = " Connection aborted by network."]
    Netreset,
    #[doc = " Network unreachable."]
    Netunreach,
    #[doc = " Too many files open in system."]
    Nfile,
    #[doc = " No buffer space available."]
    Nobufs,
    #[doc = " No such device."]
    Nodev,
    #[doc = " No such file or directory."]
    Noent,
    #[doc = " Executable file format error."]
    Noexec,
    #[doc = " No locks available."]
    Nolck,
    #[doc = " Reserved."]
    Nolink,
    #[doc = " Not enough space."]
    Nomem,
    #[doc = " No message of the desired type."]
    Nomsg,
    #[doc = " Protocol not available."]
    Noprotoopt,
    #[doc = " No space left on device."]
    Nospc,
    #[doc = " Function not supported."]
    Nosys,
    #[doc = " The socket is not connected."]
    Notconn,
    #[doc = " Not a directory or a symbolic link to a directory."]
    Notdir,
    #[doc = " Directory not empty."]
    Notempty,
    #[doc = " State not recoverable."]
    Notrecoverable,
    #[doc = " Not a socket."]
    Notsock,
    #[doc = " Not supported, or operation not supported on socket."]
    Notsup,
    #[doc = " Inappropriate I/O control operation."]
    Notty,
    #[doc = " No such device or address."]
    Nxio,
    #[doc = " Value too large to be stored in data type."]
    Overflow,
    #[doc = " Previous owner died."]
    Ownerdead,
    #[doc = " Operation not permitted."]
    Perm,
    #[doc = " Broken pipe."]
    Pipe,
    #[doc = " Protocol error."]
    Proto,
    #[doc = " Protocol not supported."]
    Protonosupport,
    #[doc = " Protocol wrong type for socket."]
    Prototype,
    #[doc = " Result too large."]
    Range,
    #[doc = " Read-only file system."]
    Rofs,
    #[doc = " Invalid seek."]
    Spipe,
    #[doc = " No such process."]
    Srch,
    #[doc = " Reserved."]
    Stale,
    #[doc = " Connection timed out."]
    Timedout,
    #[doc = " Text file busy."]
    Txtbsy,
    #[doc = " Cross-device link."]
    Xdev,
    #[doc = " Extension: Capabilities insufficient."]
    Notcapable,
    #[doc = " Cannot send after socket shutdown."]
    Shutdown,
    #[doc = " Memory access violation."]
    Memviolation,
    #[doc = " An unknown error has occured"]
    Unknown,
}
impl Errno {
    pub fn name(&self) -> &'static str {
        match self {
            Errno::Success => "success",
            Errno::Toobig => "toobig",
            Errno::Access => "access",
            Errno::Addrinuse => "addrinuse",
            Errno::Addrnotavail => "addrnotavail",
            Errno::Afnosupport => "afnosupport",
            Errno::Again => "again",
            Errno::Already => "already",
            Errno::Badf => "badf",
            Errno::Badmsg => "badmsg",
            Errno::Busy => "busy",
            Errno::Canceled => "canceled",
            Errno::Child => "child",
            Errno::Connaborted => "connaborted",
            Errno::Connrefused => "connrefused",
            Errno::Connreset => "connreset",
            Errno::Deadlk => "deadlk",
            Errno::Destaddrreq => "destaddrreq",
            Errno::Dom => "dom",
            Errno::Dquot => "dquot",
            Errno::Exist => "exist",
            Errno::Fault => "fault",
            Errno::Fbig => "fbig",
            Errno::Hostunreach => "hostunreach",
            Errno::Idrm => "idrm",
            Errno::Ilseq => "ilseq",
            Errno::Inprogress => "inprogress",
            Errno::Intr => "intr",
            Errno::Inval => "inval",
            Errno::Io => "io",
            Errno::Isconn => "isconn",
            Errno::Isdir => "isdir",
            Errno::Loop => "loop",
            Errno::Mfile => "mfile",
            Errno::Mlink => "mlink",
            Errno::Msgsize => "msgsize",
            Errno::Multihop => "multihop",
            Errno::Nametoolong => "nametoolong",
            Errno::Netdown => "netdown",
            Errno::Netreset => "netreset",
            Errno::Netunreach => "netunreach",
            Errno::Nfile => "nfile",
            Errno::Nobufs => "nobufs",
            Errno::Nodev => "nodev",
            Errno::Noent => "noent",
            Errno::Noexec => "noexec",
            Errno::Nolck => "nolck",
            Errno::Nolink => "nolink",
            Errno::Nomem => "nomem",
            Errno::Nomsg => "nomsg",
            Errno::Noprotoopt => "noprotoopt",
            Errno::Nospc => "nospc",
            Errno::Nosys => "nosys",
            Errno::Notconn => "notconn",
            Errno::Notdir => "notdir",
            Errno::Notempty => "notempty",
            Errno::Notrecoverable => "notrecoverable",
            Errno::Notsock => "notsock",
            Errno::Notsup => "notsup",
            Errno::Notty => "notty",
            Errno::Nxio => "nxio",
            Errno::Overflow => "overflow",
            Errno::Ownerdead => "ownerdead",
            Errno::Perm => "perm",
            Errno::Pipe => "pipe",
            Errno::Proto => "proto",
            Errno::Protonosupport => "protonosupport",
            Errno::Prototype => "prototype",
            Errno::Range => "range",
            Errno::Rofs => "rofs",
            Errno::Spipe => "spipe",
            Errno::Srch => "srch",
            Errno::Stale => "stale",
            Errno::Timedout => "timedout",
            Errno::Txtbsy => "txtbsy",
            Errno::Xdev => "xdev",
            Errno::Notcapable => "notcapable",
            Errno::Shutdown => "shutdown",
            Errno::Memviolation => "memviolation",
            Errno::Unknown => "unknown",
        }
    }
    pub fn message(&self) -> &'static str {
        match self {
            Errno::Success => "No error occurred. System call completed successfully.",
            Errno::Toobig => "Argument list too long.",
            Errno::Access => "Permission denied.",
            Errno::Addrinuse => "Address in use.",
            Errno::Addrnotavail => "Address not available.",
            Errno::Afnosupport => "Address family not supported.",
            Errno::Again => "Resource unavailable, or operation would block.",
            Errno::Already => "Connection already in progress.",
            Errno::Badf => "Bad file descriptor.",
            Errno::Badmsg => "Bad message.",
            Errno::Busy => "Device or resource busy.",
            Errno::Canceled => "Operation canceled.",
            Errno::Child => "No child processes.",
            Errno::Connaborted => "Connection aborted.",
            Errno::Connrefused => "Connection refused.",
            Errno::Connreset => "Connection reset.",
            Errno::Deadlk => "Resource deadlock would occur.",
            Errno::Destaddrreq => "Destination address required.",
            Errno::Dom => "Mathematics argument out of domain of function.",
            Errno::Dquot => "Reserved.",
            Errno::Exist => "File exists.",
            Errno::Fault => "Bad address.",
            Errno::Fbig => "File too large.",
            Errno::Hostunreach => "Host is unreachable.",
            Errno::Idrm => "Identifier removed.",
            Errno::Ilseq => "Illegal byte sequence.",
            Errno::Inprogress => "Operation in progress.",
            Errno::Intr => "Interrupted function.",
            Errno::Inval => "Invalid argument.",
            Errno::Io => "I/O error.",
            Errno::Isconn => "Socket is connected.",
            Errno::Isdir => "Is a directory.",
            Errno::Loop => "Too many levels of symbolic links.",
            Errno::Mfile => "File descriptor value too large.",
            Errno::Mlink => "Too many links.",
            Errno::Msgsize => "Message too large.",
            Errno::Multihop => "Reserved.",
            Errno::Nametoolong => "Filename too long.",
            Errno::Netdown => "Network is down.",
            Errno::Netreset => "Connection aborted by network.",
            Errno::Netunreach => "Network unreachable.",
            Errno::Nfile => "Too many files open in system.",
            Errno::Nobufs => "No buffer space available.",
            Errno::Nodev => "No such device.",
            Errno::Noent => "No such file or directory.",
            Errno::Noexec => "Executable file format error.",
            Errno::Nolck => "No locks available.",
            Errno::Nolink => "Reserved.",
            Errno::Nomem => "Not enough space.",
            Errno::Nomsg => "No message of the desired type.",
            Errno::Noprotoopt => "Protocol not available.",
            Errno::Nospc => "No space left on device.",
            Errno::Nosys => "Function not supported.",
            Errno::Notconn => "The socket is not connected.",
            Errno::Notdir => "Not a directory or a symbolic link to a directory.",
            Errno::Notempty => "Directory not empty.",
            Errno::Notrecoverable => "State not recoverable.",
            Errno::Notsock => "Not a socket.",
            Errno::Notsup => "Not supported, or operation not supported on socket.",
            Errno::Notty => "Inappropriate I/O control operation.",
            Errno::Nxio => "No such device or address.",
            Errno::Overflow => "Value too large to be stored in data type.",
            Errno::Ownerdead => "Previous owner died.",
            Errno::Perm => "Operation not permitted.",
            Errno::Pipe => "Broken pipe.",
            Errno::Proto => "Protocol error.",
            Errno::Protonosupport => "Protocol not supported.",
            Errno::Prototype => "Protocol wrong type for socket.",
            Errno::Range => "Result too large.",
            Errno::Rofs => "Read-only file system.",
            Errno::Spipe => "Invalid seek.",
            Errno::Srch => "No such process.",
            Errno::Stale => "Reserved.",
            Errno::Timedout => "Connection timed out.",
            Errno::Txtbsy => "Text file busy.",
            Errno::Xdev => "Cross-device link.",
            Errno::Notcapable => "Extension: Capabilities insufficient.",
            Errno::Shutdown => "Cannot send after socket shutdown.",
            Errno::Memviolation => "Memory access violation.",
            Errno::Unknown => "An unknown error has occured",
        }
    }
}
impl core::fmt::Debug for Errno {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "Errno::{}", &self.name())
    }
}
impl core::fmt::Display for Errno {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{} (error {})", self.name(), *self as i32)
    }
}
impl std::error::Error for Errno {}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " File descriptor rights, determining which actions may be performed."]
    pub struct Rights : u64 {
        #[doc = " The right to invoke `fd_datasync`."]
        #[doc = " "]
        #[doc = " If `rights::path_open` is set, includes the right to invoke"]
        #[doc = " `path_open` with `fdflags::dsync`."]
        const FD_DATASYNC = 1 << 0;
        #[doc = " The right to invoke `fd_read` and `sock_recv`."]
        #[doc = " "]
        #[doc = " If `rights::fd_seek` is set, includes the right to invoke `fd_pread`."]
        const FD_READ = 1 << 1;
        #[doc = " The right to invoke `fd_seek`. This flag implies `rights::fd_tell`."]
        const FD_SEEK = 1 << 2;
        #[doc = " The right to invoke `fd_fdstat_set_flags`."]
        const FD_FDSTAT_SET_FLAGS = 1 << 3;
        #[doc = " The right to invoke `fd_sync`."]
        #[doc = " "]
        #[doc = " If `rights::path_open` is set, includes the right to invoke"]
        #[doc = " `path_open` with `fdflags::rsync` and `fdflags::dsync`."]
        const FD_SYNC = 1 << 4;
        #[doc = " The right to invoke `fd_seek` in such a way that the file offset"]
        #[doc = " remains unaltered (i.e., `whence::cur` with offset zero), or to"]
        #[doc = " invoke `fd_tell`."]
        const FD_TELL = 1 << 5;
        #[doc = " The right to invoke `fd_write` and `sock_send`."]
        #[doc = " If `rights::fd_seek` is set, includes the right to invoke `fd_pwrite`."]
        const FD_WRITE = 1 << 6;
        #[doc = " The right to invoke `fd_advise`."]
        const FD_ADVISE = 1 << 7;
        #[doc = " The right to invoke `fd_allocate`."]
        const FD_ALLOCATE = 1 << 8;
        #[doc = " The right to invoke `path_create_directory`."]
        const PATH_CREATE_DIRECTORY = 1 << 9;
        #[doc = " If `rights::path_open` is set, the right to invoke `path_open` with `oflags::creat`."]
        const PATH_CREATE_FILE = 1 << 10;
        #[doc = " The right to invoke `path_link` with the file descriptor as the"]
        #[doc = " source directory."]
        const PATH_LINK_SOURCE = 1 << 11;
        #[doc = " The right to invoke `path_link` with the file descriptor as the"]
        #[doc = " target directory."]
        const PATH_LINK_TARGET = 1 << 12;
        #[doc = " The right to invoke `path_open`."]
        const PATH_OPEN = 1 << 13;
        #[doc = " The right to invoke `fd_readdir`."]
        const FD_READDIR = 1 << 14;
        #[doc = " The right to invoke `path_readlink`."]
        const PATH_READLINK = 1 << 15;
        #[doc = " The right to invoke `path_rename` with the file descriptor as the source directory."]
        const PATH_RENAME_SOURCE = 1 << 16;
        #[doc = " The right to invoke `path_rename` with the file descriptor as the target directory."]
        const PATH_RENAME_TARGET = 1 << 17;
        #[doc = " The right to invoke `path_filestat_get`."]
        const PATH_FILESTAT_GET = 1 << 18;
        #[doc = " The right to change a file's size (there is no `path_filestat_set_size`)."]
        #[doc = " If `rights::path_open` is set, includes the right to invoke `path_open` with `oflags::trunc`."]
        const PATH_FILESTAT_SET_SIZE = 1 << 19;
        #[doc = " The right to invoke `path_filestat_set_times`."]
        const PATH_FILESTAT_SET_TIMES = 1 << 20;
        #[doc = " The right to invoke `fd_filestat_get`."]
        const FD_FILESTAT_GET = 1 << 21;
        #[doc = " The right to invoke `fd_filestat_set_size`."]
        const FD_FILESTAT_SET_SIZE = 1 << 22;
        #[doc = " The right to invoke `fd_filestat_set_times`."]
        const FD_FILESTAT_SET_TIMES = 1 << 23;
        #[doc = " The right to invoke `path_symlink`."]
        const PATH_SYMLINK = 1 << 24;
        #[doc = " The right to invoke `path_remove_directory`."]
        const PATH_REMOVE_DIRECTORY = 1 << 25;
        #[doc = " The right to invoke `path_unlink_file`."]
        const PATH_UNLINK_FILE = 1 << 26;
        #[doc = " If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`."]
        #[doc = " If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`."]
        const POLL_FD_READWRITE = 1 << 27;
        #[doc = " The right to invoke `sock_shutdown`."]
        const SOCK_SHUTDOWN = 1 << 28;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_ACCEPT = 1 << 29;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_CONNECT = 1 << 30;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_LISTEN = 1 << 31;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_BIND = 1 << 32;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_RECV = 1 << 33;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_SEND = 1 << 34;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_ADDR_LOCAL = 1 << 35;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_ADDR_REMOTE = 1 << 36;
        # [doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_RECV_FROM = 1 << 37;
        #[doc = " TODO: Found in wasmer-wasi-types rust project, but not in wasi-snapshot0"]
        const SOCK_SEND_TO = 1 << 38;
    }
}
impl Rights {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u64) -> Self {
        Self { bits }
    }
}
#[doc = " The type of a file descriptor or file."]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Filetype {
    #[doc = " The type of the file descriptor or file is unknown or is different from any of the other types specified."]
    Unknown,
    #[doc = " The file descriptor or file refers to a block device inode."]
    BlockDevice,
    #[doc = " The file descriptor or file refers to a character device inode."]
    CharacterDevice,
    #[doc = " The file descriptor or file refers to a directory inode."]
    Directory,
    #[doc = " The file descriptor or file refers to a regular file inode."]
    RegularFile,
    #[doc = " The file descriptor or file refers to a datagram socket."]
    SocketDgram,
    #[doc = " The file descriptor or file refers to a byte-stream socket."]
    SocketStream,
    #[doc = " The file refers to a symbolic link inode."]
    SymbolicLink,
    #[doc = " The file descriptor or file refers to a raw socket."]
    SocketRaw,
    #[doc = " The file descriptor or file refers to a sequential packet socket."]
    SocketSeqpacket,
}
impl core::fmt::Debug for Filetype {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Filetype::Unknown => f.debug_tuple("Filetype::Unknown").finish(),
            Filetype::BlockDevice => f.debug_tuple("Filetype::BlockDevice").finish(),
            Filetype::CharacterDevice => f.debug_tuple("Filetype::CharacterDevice").finish(),
            Filetype::Directory => f.debug_tuple("Filetype::Directory").finish(),
            Filetype::RegularFile => f.debug_tuple("Filetype::RegularFile").finish(),
            Filetype::SocketDgram => f.debug_tuple("Filetype::SocketDgram").finish(),
            Filetype::SocketStream => f.debug_tuple("Filetype::SocketStream").finish(),
            Filetype::SymbolicLink => f.debug_tuple("Filetype::SymbolicLink").finish(),
            Filetype::SocketRaw => f.debug_tuple("Filetype::SocketRaw").finish(),
            Filetype::SocketSeqpacket => f.debug_tuple("Filetype::SocketSeqpacket").finish(),
        }
    }
}
#[doc = " A directory entry, snapshot0 version."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Snapshot0Dirent {
    #[doc = " The offset of the next directory entry stored in this directory."]
    pub d_next: Dircookie,
    #[doc = " The serial number of the file referred to by this directory entry."]
    pub d_ino: Inode,
    #[doc = " The length of the name of the directory entry."]
    pub d_namlen: Dirnamlen,
    #[doc = " The type of the file referred to by this directory entry."]
    pub d_type: Filetype,
}
impl core::fmt::Debug for Snapshot0Dirent {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Snapshot0Dirent")
            .field("d-next", &self.d_next)
            .field("d-ino", &self.d_ino)
            .field("d-namlen", &self.d_namlen)
            .field("d-type", &self.d_type)
            .finish()
    }
}
#[doc = " A directory entry."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Dirent {
    #[doc = " The offset of the next directory entry stored in this directory."]
    pub d_next: Dircookie,
    #[doc = " The serial number of the file referred to by this directory entry."]
    pub d_ino: Inode,
    #[doc = " The type of the file referred to by this directory entry."]
    pub d_type: Filetype,
    #[doc = " The length of the name of the directory entry."]
    pub d_namlen: Dirnamlen,
}
impl core::fmt::Debug for Dirent {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Dirent")
            .field("d-next", &self.d_next)
            .field("d-ino", &self.d_ino)
            .field("d-type", &self.d_type)
            .field("d-namlen", &self.d_namlen)
            .finish()
    }
}
#[doc = " File or memory access pattern advisory information."]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Advice {
    #[doc = " The application has no advice to give on its behavior with respect to the specified data."]
    Normal,
    #[doc = " The application expects to access the specified data sequentially from lower offsets to higher offsets."]
    Sequential,
    #[doc = " The application expects to access the specified data in a random order."]
    Random,
    #[doc = " The application expects to access the specified data in the near future."]
    Willneed,
    #[doc = " The application expects that it will not access the specified data in the near future."]
    Dontneed,
    #[doc = " The application expects to access the specified data once and then not reuse it thereafter."]
    Noreuse,
}
impl core::fmt::Debug for Advice {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Advice::Normal => f.debug_tuple("Advice::Normal").finish(),
            Advice::Sequential => f.debug_tuple("Advice::Sequential").finish(),
            Advice::Random => f.debug_tuple("Advice::Random").finish(),
            Advice::Willneed => f.debug_tuple("Advice::Willneed").finish(),
            Advice::Dontneed => f.debug_tuple("Advice::Dontneed").finish(),
            Advice::Noreuse => f.debug_tuple("Advice::Noreuse").finish(),
        }
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " File descriptor flags."]
    pub struct Fdflags : u16 {
        #[doc = " Append mode: Data written to the file is always appended to the file's end."]
        const APPEND = 1 << 0;
        #[doc = " Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized."]
        const DSYNC = 1 << 1;
        #[doc = " Non-blocking mode."]
        const NONBLOCK = 1 << 2;
        #[doc = " Synchronized read I/O operations."]
        const RSYNC = 1 << 3;
        #[doc = " Write according to synchronized I/O file integrity completion. In"]
        #[doc = " addition to synchronizing the data stored in the file, the implementation"]
        #[doc = " may also synchronously update the file's metadata."]
        const SYNC = 1 << 4;
    }
}
impl Fdflags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u16) -> Self {
        Self { bits }
    }
}
#[doc = " File descriptor attributes."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Fdstat {
    #[doc = " File type."]
    pub fs_filetype: Filetype,
    #[doc = " File descriptor flags."]
    pub fs_flags: Fdflags,
    #[doc = " Rights that apply to this file descriptor."]
    pub fs_rights_base: Rights,
    #[doc = " Maximum set of rights that may be installed on new file descriptors that"]
    #[doc = " are created through this file descriptor, e.g., through `path_open`."]
    pub fs_rights_inheriting: Rights,
}
impl core::fmt::Debug for Fdstat {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Fdstat")
            .field("fs-filetype", &self.fs_filetype)
            .field("fs-flags", &self.fs_flags)
            .field("fs-rights-base", &self.fs_rights_base)
            .field("fs-rights-inheriting", &self.fs_rights_inheriting)
            .finish()
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " Which file time attributes to adjust."]
    #[doc = " TODO: wit appears to not have support for flags repr"]
    #[doc = " (@witx repr u16)"]
    pub struct Fstflags : u16 {
        #[doc = " Adjust the last data access timestamp to the value stored in `filestat::atim`."]
        const SET_ATIM = 1 << 0;
        #[doc = " Adjust the last data access timestamp to the time of clock `clockid::realtime`."]
        const SET_ATIM_NOW = 1 << 1;
        #[doc = " Adjust the last data modification timestamp to the value stored in `filestat::mtim`."]
        const SET_MTIM = 1 << 2;
        #[doc = " Adjust the last data modification timestamp to the time of clock `clockid::realtime`."]
        const SET_MTIM_NOW = 1 << 3;
    }
}
impl Fstflags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u16) -> Self {
        Self { bits }
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " Flags determining the method of how paths are resolved."]
    #[doc = " TODO: wit appears to not have support for flags repr"]
    #[doc = " (@witx repr u32)"]
    pub struct Lookup : u32 {
        #[doc = " As long as the resolved path corresponds to a symbolic link, it is expanded."]
        const SYMLINK_FOLLOW = 1 << 0;
    }
}
impl Lookup {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u32) -> Self {
        Self { bits }
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " Open flags used by `path_open`."]
    #[doc = " TODO: wit appears to not have support for flags repr"]
    #[doc = " (@witx repr u16)"]
    pub struct Oflags : u16 {
        #[doc = " Create file if it does not exist."]
        const CREATE = 1 << 0;
        #[doc = " Fail if not a directory."]
        const DIRECTORY = 1 << 1;
        #[doc = " Fail if file already exists."]
        const EXCL = 1 << 2;
        #[doc = " Truncate file to size 0."]
        const TRUNC = 1 << 3;
    }
}
impl Oflags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u16) -> Self {
        Self { bits }
    }
}
#[doc = " User-provided value that may be attached to objects that is retained when"]
#[doc = " extracted from the implementation."]
pub type Userdata = u64;
#[doc = " Type of a subscription to an event or its occurrence."]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub enum Eventtype {
    #[doc = " The time value of clock `subscription_clock::id` has"]
    #[doc = " reached timestamp `subscription_clock::timeout`."]
    Clock,
    #[doc = " File descriptor `subscription_fd_readwrite::fd` has data"]
    #[doc = " available for reading. This event always triggers for regular files."]
    FdRead,
    #[doc = " File descriptor `subscription_fd_readwrite::fd` has capacity"]
    #[doc = " available for writing. This event always triggers for regular files."]
    FdWrite,
}
impl core::fmt::Debug for Eventtype {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Eventtype::Clock => f.debug_tuple("Eventtype::Clock").finish(),
            Eventtype::FdRead => f.debug_tuple("Eventtype::FdRead").finish(),
            Eventtype::FdWrite => f.debug_tuple("Eventtype::FdWrite").finish(),
        }
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " Flags determining how to interpret the timestamp provided in"]
    #[doc = " `subscription-clock::timeout`."]
    pub struct Subclockflags : u16 {
        #[doc = " If set, treat the timestamp provided in"]
        #[doc = " `subscription-clock::timeout` as an absolute timestamp of clock"]
        #[doc = " `subscription-clock::id`. If clear, treat the timestamp"]
        #[doc = " provided in `subscription-clock::timeout` relative to the"]
        #[doc = " current time value of clock `subscription-clock::id`."]
        const SUBSCRIPTION_CLOCK_ABSTIME = 1 << 0;
    }
}
impl Subclockflags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u16) -> Self {
        Self { bits }
    }
}
#[doc = " The contents of a `subscription` when type is `eventtype::clock`."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Snapshot0SubscriptionClock {
    #[doc = " The user-defined unique identifier of the clock."]
    pub identifier: Userdata,
    #[doc = " The clock against which to compare the timestamp."]
    pub id: Snapshot0Clockid,
    #[doc = " The absolute or relative timestamp."]
    pub timeout: Timestamp,
    #[doc = " The amount of time that the implementation may wait additionally"]
    #[doc = " to coalesce with other events."]
    pub precision: Timestamp,
    #[doc = " Flags specifying whether the timeout is absolute or relative"]
    pub flags: Subclockflags,
}
impl core::fmt::Debug for Snapshot0SubscriptionClock {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Snapshot0SubscriptionClock")
            .field("identifier", &self.identifier)
            .field("id", &self.id)
            .field("timeout", &self.timeout)
            .field("precision", &self.precision)
            .field("flags", &self.flags)
            .finish()
    }
}
#[doc = " The contents of a `subscription` when type is `eventtype::clock`."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SubscriptionClock {
    #[doc = " The clock against which to compare the timestamp."]
    pub clock_id: Clockid,
    #[doc = " The absolute or relative timestamp."]
    pub timeout: Timestamp,
    #[doc = " The amount of time that the implementation may wait additionally"]
    #[doc = " to coalesce with other events."]
    pub precision: Timestamp,
    #[doc = " Flags specifying whether the timeout is absolute or relative"]
    pub flags: Subclockflags,
}
impl core::fmt::Debug for SubscriptionClock {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("SubscriptionClock")
            .field("clock-id", &self.clock_id)
            .field("timeout", &self.timeout)
            .field("precision", &self.precision)
            .field("flags", &self.flags)
            .finish()
    }
}
#[doc = " Identifiers for preopened capabilities."]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Preopentype {
    #[doc = " A pre-opened directory."]
    Dir,
}
impl core::fmt::Debug for Preopentype {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Preopentype::Dir => f.debug_tuple("Preopentype::Dir").finish(),
        }
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " The state of the file descriptor subscribed to with"]
    #[doc = " `eventtype::fd_read` or `eventtype::fd_write`."]
    #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
    pub struct Eventrwflags : u16 {
        #[doc = " The peer of this socket has closed or disconnected."]
        const FD_READWRITE_HANGUP = 1 << 0;
    }
}
impl Eventrwflags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u16) -> Self {
        Self { bits }
    }
}
#[doc = " The contents of an `event` for the `eventtype::fd_read` and"]
#[doc = " `eventtype::fd_write` variants"]
#[repr(C)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct EventFdReadwrite {
    #[doc = " The number of bytes available for reading or writing."]
    pub nbytes: Filesize,
    #[doc = " The state of the file descriptor."]
    pub flags: Eventrwflags,
}
impl core::fmt::Debug for EventFdReadwrite {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("EventFdReadwrite")
            .field("nbytes", &self.nbytes)
            .field("flags", &self.flags)
            .finish()
    }
}
#[doc = " An event that occurred."]
#[doc = " The contents of an `event`."]
#[doc = " An event that occurred."]
#[doc = " The contents of a `subscription`, snapshot0 version."]
#[doc = " The contents of a `subscription`."]
#[doc = " The contents of a `subscription` when the variant is"]
#[doc = " `eventtype::fd_read` or `eventtype::fd_write`."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SubscriptionFsReadwrite {
    #[doc = " The file descriptor on which to wait for it to become ready for reading or writing."]
    pub file_descriptor: Fd,
}
impl core::fmt::Debug for SubscriptionFsReadwrite {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("SubscriptionFsReadwrite")
            .field("file-descriptor", &self.file_descriptor)
            .finish()
    }
}
#[repr(u16)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Socktype {
    Unknown,
    Stream,
    Dgram,
    Raw,
    Seqpacket,
}
impl core::fmt::Debug for Socktype {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Socktype::Unknown => f.debug_tuple("Socktype::Uknown").finish(),
            Socktype::Stream => f.debug_tuple("Socktype::Stream").finish(),
            Socktype::Dgram => f.debug_tuple("Socktype::Dgram").finish(),
            Socktype::Raw => f.debug_tuple("Socktype::Raw").finish(),
            Socktype::Seqpacket => f.debug_tuple("Socktype::Seqpacket").finish(),
        }
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Sockstatus {
    Opening,
    Opened,
    Closed,
    Failed,
}
impl core::fmt::Debug for Sockstatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Sockstatus::Opening => f.debug_tuple("Sockstatus::Opening").finish(),
            Sockstatus::Opened => f.debug_tuple("Sockstatus::Opened").finish(),
            Sockstatus::Closed => f.debug_tuple("Sockstatus::Closed").finish(),
            Sockstatus::Failed => f.debug_tuple("Sockstatus::Failed").finish(),
        }
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Sockoption {
    Noop,
    ReusePort,
    ReuseAddr,
    NoDelay,
    DontRoute,
    OnlyV6,
    Broadcast,
    MulticastLoopV4,
    MulticastLoopV6,
    Promiscuous,
    Listening,
    LastError,
    KeepAlive,
    Linger,
    OobInline,
    RecvBufSize,
    SendBufSize,
    RecvLowat,
    SendLowat,
    RecvTimeout,
    SendTimeout,
    ConnectTimeout,
    AcceptTimeout,
    Ttl,
    MulticastTtlV4,
    Type,
    Proto,
}
impl core::fmt::Debug for Sockoption {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Sockoption::Noop => f.debug_tuple("Sockoption::Noop").finish(),
            Sockoption::ReusePort => f.debug_tuple("Sockoption::ReusePort").finish(),
            Sockoption::ReuseAddr => f.debug_tuple("Sockoption::ReuseAddr").finish(),
            Sockoption::NoDelay => f.debug_tuple("Sockoption::NoDelay").finish(),
            Sockoption::DontRoute => f.debug_tuple("Sockoption::DontRoute").finish(),
            Sockoption::OnlyV6 => f.debug_tuple("Sockoption::OnlyV6").finish(),
            Sockoption::Broadcast => f.debug_tuple("Sockoption::Broadcast").finish(),
            Sockoption::MulticastLoopV4 => f.debug_tuple("Sockoption::MulticastLoopV4").finish(),
            Sockoption::MulticastLoopV6 => f.debug_tuple("Sockoption::MulticastLoopV6").finish(),
            Sockoption::Promiscuous => f.debug_tuple("Sockoption::Promiscuous").finish(),
            Sockoption::Listening => f.debug_tuple("Sockoption::Listening").finish(),
            Sockoption::LastError => f.debug_tuple("Sockoption::LastError").finish(),
            Sockoption::KeepAlive => f.debug_tuple("Sockoption::KeepAlive").finish(),
            Sockoption::Linger => f.debug_tuple("Sockoption::Linger").finish(),
            Sockoption::OobInline => f.debug_tuple("Sockoption::OobInline").finish(),
            Sockoption::RecvBufSize => f.debug_tuple("Sockoption::RecvBufSize").finish(),
            Sockoption::SendBufSize => f.debug_tuple("Sockoption::SendBufSize").finish(),
            Sockoption::RecvLowat => f.debug_tuple("Sockoption::RecvLowat").finish(),
            Sockoption::SendLowat => f.debug_tuple("Sockoption::SendLowat").finish(),
            Sockoption::RecvTimeout => f.debug_tuple("Sockoption::RecvTimeout").finish(),
            Sockoption::SendTimeout => f.debug_tuple("Sockoption::SendTimeout").finish(),
            Sockoption::ConnectTimeout => f.debug_tuple("Sockoption::ConnectTimeout").finish(),
            Sockoption::AcceptTimeout => f.debug_tuple("Sockoption::AcceptTimeout").finish(),
            Sockoption::Ttl => f.debug_tuple("Sockoption::Ttl").finish(),
            Sockoption::MulticastTtlV4 => f.debug_tuple("Sockoption::MulticastTtlV4").finish(),
            Sockoption::Type => f.debug_tuple("Sockoption::Type").finish(),
            Sockoption::Proto => f.debug_tuple("Sockoption::Proto").finish(),
        }
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Streamsecurity {
    Unencrypted,
    AnyEncryption,
    ClassicEncryption,
    DoubleEncryption,
}
impl core::fmt::Debug for Streamsecurity {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Streamsecurity::Unencrypted => f.debug_tuple("Streamsecurity::Unencrypted").finish(),
            Streamsecurity::AnyEncryption => {
                f.debug_tuple("Streamsecurity::AnyEncryption").finish()
            }
            Streamsecurity::ClassicEncryption => {
                f.debug_tuple("Streamsecurity::ClassicEncryption").finish()
            }
            Streamsecurity::DoubleEncryption => {
                f.debug_tuple("Streamsecurity::DoubleEncryption").finish()
            }
        }
    }
}
#[repr(u16)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Addressfamily {
    Unspec,
    Inet4,
    Inet6,
    Unix,
}
impl core::fmt::Debug for Addressfamily {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Addressfamily::Unspec => f.debug_tuple("Addressfamily::Unspec").finish(),
            Addressfamily::Inet4 => f.debug_tuple("Addressfamily::Inet4").finish(),
            Addressfamily::Inet6 => f.debug_tuple("Addressfamily::Inet6").finish(),
            Addressfamily::Unix => f.debug_tuple("Addressfamily::Unix").finish(),
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Snapshot0Filestat {
    pub st_dev: Device,
    pub st_ino: Inode,
    pub st_filetype: Filetype,
    pub st_nlink: Snapshot0Linkcount,
    pub st_size: Filesize,
    pub st_atim: Timestamp,
    pub st_mtim: Timestamp,
    pub st_ctim: Timestamp,
}
impl core::fmt::Debug for Snapshot0Filestat {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Snapshot0Filestat")
            .field("st-dev", &self.st_dev)
            .field("st-ino", &self.st_ino)
            .field("st-filetype", &self.st_filetype)
            .field("st-nlink", &self.st_nlink)
            .field("st-size", &self.st_size)
            .field("st-atim", &self.st_atim)
            .field("st-mtim", &self.st_mtim)
            .field("st-ctim", &self.st_ctim)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Filestat {
    pub st_dev: Device,
    pub st_ino: Inode,
    pub st_filetype: Filetype,
    pub st_nlink: Linkcount,
    pub st_size: Filesize,
    pub st_atim: Timestamp,
    pub st_mtim: Timestamp,
    pub st_ctim: Timestamp,
}
impl core::fmt::Debug for Filestat {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Filestat")
            .field("st-dev", &self.st_dev)
            .field("st-ino", &self.st_ino)
            .field("st-filetype", &self.st_filetype)
            .field("st-nlink", &self.st_nlink)
            .field("st-size", &self.st_size)
            .field("st-atim", &self.st_atim)
            .field("st-mtim", &self.st_mtim)
            .field("st-ctim", &self.st_ctim)
            .finish()
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Snapshot0Whence {
    Cur,
    End,
    Set,
}
impl core::fmt::Debug for Snapshot0Whence {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Snapshot0Whence::Cur => f.debug_tuple("Snapshot0Whence::Cur").finish(),
            Snapshot0Whence::End => f.debug_tuple("Snapshot0Whence::End").finish(),
            Snapshot0Whence::Set => f.debug_tuple("Snapshot0Whence::Set").finish(),
        }
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Whence {
    Set,
    Cur,
    End,
}
impl core::fmt::Debug for Whence {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Whence::Set => f.debug_tuple("Whence::Set").finish(),
            Whence::Cur => f.debug_tuple("Whence::Cur").finish(),
            Whence::End => f.debug_tuple("Whence::End").finish(),
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Tty {
    pub cols: u32,
    pub rows: u32,
    pub width: u32,
    pub height: u32,
    pub stdin_tty: bool,
    pub stdout_tty: bool,
    pub stderr_tty: bool,
    pub echo: bool,
    pub line_buffered: bool,
}
impl core::fmt::Debug for Tty {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Tty")
            .field("cols", &self.cols)
            .field("rows", &self.rows)
            .field("width", &self.width)
            .field("height", &self.height)
            .field("stdin-tty", &self.stdin_tty)
            .field("stdout-tty", &self.stdout_tty)
            .field("stderr-tty", &self.stderr_tty)
            .field("echo", &self.echo)
            .field("line-buffered", &self.line_buffered)
            .finish()
    }
}

#[doc = " __wasi_option_t"]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum OptionTag {
    None,
    Some,
}
impl core::fmt::Debug for OptionTag {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            OptionTag::None => f.debug_tuple("OptionTag::None").finish(),
            OptionTag::Some => f.debug_tuple("OptionTag::Some").finish(),
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct OptionPid {
    pub tag: OptionTag,
    pub pid: Pid,
}
impl core::fmt::Debug for OptionPid {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("OptionPid")
            .field("tag", &self.tag)
            .field("pid", &self.pid)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct OptionFd {
    pub tag: OptionTag,
    pub fd: Fd,
}
impl core::fmt::Debug for OptionFd {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("OptionFd")
            .field("tag", &self.tag)
            .field("fd", &self.fd)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ProcessHandles {
    pub pid: Pid,
    pub stdin: OptionFd,
    pub stdout: OptionFd,
    pub stderr: OptionFd,
}
impl core::fmt::Debug for ProcessHandles {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("ProcessHandles")
            .field("pid", &self.pid)
            .field("stdin", &self.stdin)
            .field("stdout", &self.stdout)
            .field("stderr", &self.stderr)
            .finish()
    }
}
pub type EventFdFlags = u16;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PrestatUDir {
    pub pr_name_len: u32,
}
impl core::fmt::Debug for PrestatUDir {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("PrestatUDir")
            .field("pr-name-len", &self.pr_name_len)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PrestatU {
    pub dir: PrestatUDir,
}
impl core::fmt::Debug for PrestatU {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("PrestatU").field("dir", &self.dir).finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Prestat {
    pub pr_type: Preopentype,
    pub u: PrestatU,
}
impl core::fmt::Debug for Prestat {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("Prestat")
            .field("pr-type", &self.pr_type)
            .field("u", &self.u)
            .finish()
    }
}
pub type FileDelta = i64;
pub type LookupFlags = u32;
pub type Count = u32;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PipeHandles {
    pub pipe: Fd,
    pub other: Fd,
}
impl core::fmt::Debug for PipeHandles {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("PipeHandles")
            .field("pipe", &self.pipe)
            .field("other", &self.other)
            .finish()
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum StdioMode {
    Reserved,
    Piped,
    Inherit,
    Null,
    Log,
}
impl core::fmt::Debug for StdioMode {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            StdioMode::Reserved => f.debug_tuple("StdioMode::Reserved").finish(),
            StdioMode::Piped => f.debug_tuple("StdioMode::Piped").finish(),
            StdioMode::Inherit => f.debug_tuple("StdioMode::Inherit").finish(),
            StdioMode::Null => f.debug_tuple("StdioMode::Null").finish(),
            StdioMode::Log => f.debug_tuple("StdioMode::Log").finish(),
        }
    }
}
#[repr(u16)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum SockProto {
    Ip,
    Icmp,
    Igmp,
    ProtoThree,
    Ipip,
    ProtoFive,
    Tcp,
    ProtoSeven,
    Egp,
    ProtoNine,
    ProtoTen,
    ProtoEleven,
    Pup,
    ProtoThirteen,
    ProtoFourteen,
    ProtoFifteen,
    ProtoSixteen,
    Udp,
    ProtoEighteen,
    ProtoNineteen,
    ProtoTwenty,
    ProtoTwentyone,
    Idp,
    ProtoTwentythree,
    ProtoTwentyfour,
    ProtoTwentyfive,
    ProtoTwentysix,
    ProtoTwentyseven,
    ProtoTwentyeight,
    ProtoTp,
    ProtoThirty,
    ProtoThirtyone,
    ProtoThirtytwo,
    Dccp,
    ProtoThirtyfour,
    ProtoThirtyfive,
    ProtoThirtysix,
    ProtoThirtyseven,
    ProtoThirtyeight,
    ProtoThirtynine,
    ProtoFourty,
    Ipv6,
    ProtoFourtytwo,
    Routing,
    Fragment,
    ProtoFourtyfive,
    Rsvp,
    Gre,
    ProtoFourtyeight,
    ProtoFourtynine,
    Esp,
    Ah,
    ProtoFiftytwo,
    ProtoFiftythree,
    ProtoFiftyfour,
    ProtoFiftyfive,
    ProtoFiftysix,
    ProtoFiftyseven,
    Icmpv6,
    None,
    Dstopts,
    ProtoSixtyone,
    ProtoSixtytwo,
    ProtoSixtythree,
    ProtoSixtyfour,
    ProtoSixtyfive,
    ProtoSixtysix,
    ProtoSixtyseven,
    ProtoSixtyeight,
    ProtoSixtynine,
    ProtoSeventy,
    ProtoSeventyone,
    ProtoSeventytwo,
    ProtoSeventythree,
    ProtoSeventyfour,
    ProtoSeventyfive,
    ProtoSeventysix,
    ProtoSeventyseven,
    ProtoSeventyeight,
    ProtoSeventynine,
    ProtoEighty,
    ProtoEightyone,
    ProtoEightytwo,
    ProtoEightythree,
    ProtoEightyfour,
    ProtoEightyfive,
    ProtoEightysix,
    ProtoEightyseven,
    ProtoEightyeight,
    ProtoEightynine,
    ProtoNinety,
    ProtoNinetyone,
    Mtp,
    ProtoNinetythree,
    Beetph,
    ProtoNinetyfive,
    ProtoNinetysix,
    ProtoNineetyseven,
    Encap,
    ProtoNinetynine,
    ProtoOnehundred,
    ProtoOnehundredandone,
    ProtoOnehundredandtwo,
    Pim,
    ProtoOnehundredandfour,
    ProtoOnehundredandfive,
    ProtoOnehundredandsix,
    ProtoOnehundredandseven,
    Comp,
    ProtoOnehundredandnine,
    ProtoOnehundredandten,
    ProtoOnehundredandeleven,
    ProtoOnehundredandtwelve,
    ProtoOnehundredandthirteen,
    ProtoOnehundredandfourteen,
    ProtoOnehundredandfifteen,
    ProtoOnehundredandsixteen,
    ProtoOnehundredandseventeen,
    ProtoOnehundredandeighteen,
    ProtoOnehundredandnineteen,
    ProtoOnehundredandtwenty,
    ProtoOnehundredandtwentyone,
    ProtoOnehundredandtwentytwo,
    ProtoOnehundredandtwentythree,
    ProtoOnehundredandtwentyfour,
    ProtoOnehundredandtwentyfive,
    ProtoOnehundredandtwentysix,
    ProtoOnehundredandtwentyseven,
    ProtoOnehundredandtwentyeight,
    ProtoOnehundredandtwentynine,
    ProtoOnehundredandthirty,
    ProtoOnehundredandthirtyone,
    Sctp,
    ProtoOnehundredandthirtythree,
    ProtoOnehundredandthirtyfour,
    Mh,
    Udplite,
    Mpls,
    ProtoOnehundredandthirtyeight,
    ProtoOnehundredandthirtynine,
    ProtoOnehundredandfourty,
    ProtoOnehundredandfourtyone,
    ProtoOnehundredandfourtytwo,
    Ethernet,
    ProtoOnehundredandfourtyfour,
    ProtoOnehundredandfourtyfive,
    ProtoOnehundredandfourtysix,
    ProtoOnehundredandfourtyseven,
    ProtoOnehundredandfourtyeight,
    ProtoOnehundredandfourtynine,
    ProtoOnehundredandfifty,
    ProtoOnehundredandfiftyone,
    ProtoOnehundredandfiftytwo,
    ProtoOnehundredandfiftythree,
    ProtoOnehundredandfiftyfour,
    ProtoOnehundredandfiftyfive,
    ProtoOnehundredandfiftysix,
    ProtoOnehundredandfiftyseven,
    ProtoOnehundredandfiftyeight,
    ProtoOnehundredandfiftynine,
    ProtoOnehundredandsixty,
    ProtoOnehundredandsixtyone,
    ProtoOnehundredandsixtytwo,
    ProtoOnehundredandsixtythree,
    ProtoOnehundredandsixtyfour,
    ProtoOnehundredandsixtyfive,
    ProtoOnehundredandsixtysix,
    ProtoOnehundredandsixtyseven,
    ProtoOnehundredandsixtyeight,
    ProtoOnehundredandsixtynine,
    ProtoOnehundredandseventy,
    ProtoOnehundredandseventyone,
    ProtoOnehundredandseventytwo,
    ProtoOnehundredandseventythree,
    ProtoOnehundredandseventyfour,
    ProtoOnehundredandseventyfive,
    ProtoOnehundredandseventysix,
    ProtoOnehundredandseventyseven,
    ProtoOnehundredandseventyeight,
    ProtoOnehundredandseventynine,
    ProtoOnehundredandeighty,
    ProtoOnehundredandeightyone,
    ProtoOnehundredandeightytwo,
    ProtoOnehundredandeightythree,
    ProtoOnehundredandeightyfour,
    ProtoOnehundredandeightyfive,
    ProtoOnehundredandeightysix,
    ProtoOnehundredandeightyseven,
    ProtoOnehundredandeightyeight,
    ProtoOnehundredandeightynine,
    ProtoOnehundredandninety,
    ProtoOnehundredandninetyone,
    ProtoOnehundredandninetytwo,
    ProtoOnehundredandninetythree,
    ProtoOnehundredandninetyfour,
    ProtoOnehundredandninetyfive,
    ProtoOnehundredandninetysix,
    ProtoOnehundredandninetyseven,
    ProtoOnehundredandninetyeight,
    ProtoOnehundredandninetynine,
    ProtoTwohundred,
    ProtoTwohundredandone,
    ProtoTwohundredandtwo,
    ProtoTwohundredandthree,
    ProtoTwohundredandfour,
    ProtoTwohundredandfive,
    ProtoTwohundredandsix,
    ProtoTwohundredandseven,
    ProtoTwohundredandeight,
    ProtoTwohundredandnine,
    ProtoTwohundredandten,
    ProtoTwohundredandeleven,
    ProtoTwohundredandtwelve,
    ProtoTwohundredandthirteen,
    ProtoTwohundredandfourteen,
    ProtoTwohundredandfifteen,
    ProtoTwohundredandsixteen,
    ProtoTwohundredandseventeen,
    ProtoTwohundredandeighteen,
    ProtoTwohundredandnineteen,
    ProtoTwohundredandtwenty,
    ProtoTwohundredandtwentyone,
    ProtoTwohundredandtwentytwo,
    ProtoTwohundredandtwentythree,
    ProtoTwohundredandtwentyfour,
    ProtoTwohundredandtwentyfive,
    ProtoTwohundredandtwentysix,
    ProtoTwohundredandtwentyseven,
    ProtoTwohundredandtwentyeight,
    ProtoTwohundredandtwentynine,
    ProtoTwohundredandthirty,
    ProtoTwohundredandthirtyone,
    ProtoTwohundredandthirtytwo,
    ProtoTwohundredandthirtythree,
    ProtoTwohundredandthirtyfour,
    ProtoTwohundredandthirtyfive,
    ProtoTwohundredandthirtysix,
    ProtoTwohundredandthirtyseven,
    ProtoTwohundredandthirtyeight,
    ProtoTwohundredandthirtynine,
    ProtoTwohundredandfourty,
    ProtoTwohundredandfourtyone,
    ProtoTwohundredandfourtytwo,
    ProtoTwohundredandfourtythree,
    ProtoTwohundredandfourtyfour,
    ProtoTwohundredandfourtyfive,
    ProtoTwohundredandfourtysix,
    ProtoTwohundredandfourtyseven,
    ProtoTwohundredandfourtyeight,
    ProtoTwohundredandfourtynine,
    ProtoTwohundredandfifty,
    ProtoTwohundredandfiftyone,
    ProtoTwohundredandfiftytwo,
    ProtoTwohundredandfiftythree,
    ProtoTwohundredandfiftyfour,
    ProtoRaw,
    ProtoTwohundredandfiftysix,
    ProtoTwohundredandfiftyseven,
    ProtoTwohundredandfiftyeight,
    ProtoTwohundredandfiftynine,
    ProtoTwohundredandsixty,
    ProtoTwohundredandsixtyone,
    Mptcp,
    Max,
}
impl core::fmt::Debug for SockProto {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            SockProto::Ip => f.debug_tuple("SockProto::Ip").finish(),
            SockProto::Icmp => f.debug_tuple("SockProto::Icmp").finish(),
            SockProto::Igmp => f.debug_tuple("SockProto::Igmp").finish(),
            SockProto::ProtoThree => f.debug_tuple("SockProto::ProtoThree").finish(),
            SockProto::Ipip => f.debug_tuple("SockProto::Ipip").finish(),
            SockProto::ProtoFive => f.debug_tuple("SockProto::ProtoFive").finish(),
            SockProto::Tcp => f.debug_tuple("SockProto::Tcp").finish(),
            SockProto::ProtoSeven => f.debug_tuple("SockProto::ProtoSeven").finish(),
            SockProto::Egp => f.debug_tuple("SockProto::Egp").finish(),
            SockProto::ProtoNine => f.debug_tuple("SockProto::ProtoNine").finish(),
            SockProto::ProtoTen => f.debug_tuple("SockProto::ProtoTen").finish(),
            SockProto::ProtoEleven => f.debug_tuple("SockProto::ProtoEleven").finish(),
            SockProto::Pup => f.debug_tuple("SockProto::Pup").finish(),
            SockProto::ProtoThirteen => f.debug_tuple("SockProto::ProtoThirteen").finish(),
            SockProto::ProtoFourteen => f.debug_tuple("SockProto::ProtoFourteen").finish(),
            SockProto::ProtoFifteen => f.debug_tuple("SockProto::ProtoFifteen").finish(),
            SockProto::ProtoSixteen => f.debug_tuple("SockProto::ProtoSixteen").finish(),
            SockProto::Udp => f.debug_tuple("SockProto::Udp").finish(),
            SockProto::ProtoEighteen => f.debug_tuple("SockProto::ProtoEighteen").finish(),
            SockProto::ProtoNineteen => f.debug_tuple("SockProto::ProtoNineteen").finish(),
            SockProto::ProtoTwenty => f.debug_tuple("SockProto::ProtoTwenty").finish(),
            SockProto::ProtoTwentyone => f.debug_tuple("SockProto::ProtoTwentyone").finish(),
            SockProto::Idp => f.debug_tuple("SockProto::Idp").finish(),
            SockProto::ProtoTwentythree => f.debug_tuple("SockProto::ProtoTwentythree").finish(),
            SockProto::ProtoTwentyfour => f.debug_tuple("SockProto::ProtoTwentyfour").finish(),
            SockProto::ProtoTwentyfive => f.debug_tuple("SockProto::ProtoTwentyfive").finish(),
            SockProto::ProtoTwentysix => f.debug_tuple("SockProto::ProtoTwentysix").finish(),
            SockProto::ProtoTwentyseven => f.debug_tuple("SockProto::ProtoTwentyseven").finish(),
            SockProto::ProtoTwentyeight => f.debug_tuple("SockProto::ProtoTwentyeight").finish(),
            SockProto::ProtoTp => f.debug_tuple("SockProto::ProtoTp").finish(),
            SockProto::ProtoThirty => f.debug_tuple("SockProto::ProtoThirty").finish(),
            SockProto::ProtoThirtyone => f.debug_tuple("SockProto::ProtoThirtyone").finish(),
            SockProto::ProtoThirtytwo => f.debug_tuple("SockProto::ProtoThirtytwo").finish(),
            SockProto::Dccp => f.debug_tuple("SockProto::Dccp").finish(),
            SockProto::ProtoThirtyfour => f.debug_tuple("SockProto::ProtoThirtyfour").finish(),
            SockProto::ProtoThirtyfive => f.debug_tuple("SockProto::ProtoThirtyfive").finish(),
            SockProto::ProtoThirtysix => f.debug_tuple("SockProto::ProtoThirtysix").finish(),
            SockProto::ProtoThirtyseven => f.debug_tuple("SockProto::ProtoThirtyseven").finish(),
            SockProto::ProtoThirtyeight => f.debug_tuple("SockProto::ProtoThirtyeight").finish(),
            SockProto::ProtoThirtynine => f.debug_tuple("SockProto::ProtoThirtynine").finish(),
            SockProto::ProtoFourty => f.debug_tuple("SockProto::ProtoFourty").finish(),
            SockProto::Ipv6 => f.debug_tuple("SockProto::Ipv6").finish(),
            SockProto::ProtoFourtytwo => f.debug_tuple("SockProto::ProtoFourtytwo").finish(),
            SockProto::Routing => f.debug_tuple("SockProto::Routing").finish(),
            SockProto::Fragment => f.debug_tuple("SockProto::Fragment").finish(),
            SockProto::ProtoFourtyfive => f.debug_tuple("SockProto::ProtoFourtyfive").finish(),
            SockProto::Rsvp => f.debug_tuple("SockProto::Rsvp").finish(),
            SockProto::Gre => f.debug_tuple("SockProto::Gre").finish(),
            SockProto::ProtoFourtyeight => f.debug_tuple("SockProto::ProtoFourtyeight").finish(),
            SockProto::ProtoFourtynine => f.debug_tuple("SockProto::ProtoFourtynine").finish(),
            SockProto::Esp => f.debug_tuple("SockProto::Esp").finish(),
            SockProto::Ah => f.debug_tuple("SockProto::Ah").finish(),
            SockProto::ProtoFiftytwo => f.debug_tuple("SockProto::ProtoFiftytwo").finish(),
            SockProto::ProtoFiftythree => f.debug_tuple("SockProto::ProtoFiftythree").finish(),
            SockProto::ProtoFiftyfour => f.debug_tuple("SockProto::ProtoFiftyfour").finish(),
            SockProto::ProtoFiftyfive => f.debug_tuple("SockProto::ProtoFiftyfive").finish(),
            SockProto::ProtoFiftysix => f.debug_tuple("SockProto::ProtoFiftysix").finish(),
            SockProto::ProtoFiftyseven => f.debug_tuple("SockProto::ProtoFiftyseven").finish(),
            SockProto::Icmpv6 => f.debug_tuple("SockProto::Icmpv6").finish(),
            SockProto::None => f.debug_tuple("SockProto::None").finish(),
            SockProto::Dstopts => f.debug_tuple("SockProto::Dstopts").finish(),
            SockProto::ProtoSixtyone => f.debug_tuple("SockProto::ProtoSixtyone").finish(),
            SockProto::ProtoSixtytwo => f.debug_tuple("SockProto::ProtoSixtytwo").finish(),
            SockProto::ProtoSixtythree => f.debug_tuple("SockProto::ProtoSixtythree").finish(),
            SockProto::ProtoSixtyfour => f.debug_tuple("SockProto::ProtoSixtyfour").finish(),
            SockProto::ProtoSixtyfive => f.debug_tuple("SockProto::ProtoSixtyfive").finish(),
            SockProto::ProtoSixtysix => f.debug_tuple("SockProto::ProtoSixtysix").finish(),
            SockProto::ProtoSixtyseven => f.debug_tuple("SockProto::ProtoSixtyseven").finish(),
            SockProto::ProtoSixtyeight => f.debug_tuple("SockProto::ProtoSixtyeight").finish(),
            SockProto::ProtoSixtynine => f.debug_tuple("SockProto::ProtoSixtynine").finish(),
            SockProto::ProtoSeventy => f.debug_tuple("SockProto::ProtoSeventy").finish(),
            SockProto::ProtoSeventyone => f.debug_tuple("SockProto::ProtoSeventyone").finish(),
            SockProto::ProtoSeventytwo => f.debug_tuple("SockProto::ProtoSeventytwo").finish(),
            SockProto::ProtoSeventythree => f.debug_tuple("SockProto::ProtoSeventythree").finish(),
            SockProto::ProtoSeventyfour => f.debug_tuple("SockProto::ProtoSeventyfour").finish(),
            SockProto::ProtoSeventyfive => f.debug_tuple("SockProto::ProtoSeventyfive").finish(),
            SockProto::ProtoSeventysix => f.debug_tuple("SockProto::ProtoSeventysix").finish(),
            SockProto::ProtoSeventyseven => f.debug_tuple("SockProto::ProtoSeventyseven").finish(),
            SockProto::ProtoSeventyeight => f.debug_tuple("SockProto::ProtoSeventyeight").finish(),
            SockProto::ProtoSeventynine => f.debug_tuple("SockProto::ProtoSeventynine").finish(),
            SockProto::ProtoEighty => f.debug_tuple("SockProto::ProtoEighty").finish(),
            SockProto::ProtoEightyone => f.debug_tuple("SockProto::ProtoEightyone").finish(),
            SockProto::ProtoEightytwo => f.debug_tuple("SockProto::ProtoEightytwo").finish(),
            SockProto::ProtoEightythree => f.debug_tuple("SockProto::ProtoEightythree").finish(),
            SockProto::ProtoEightyfour => f.debug_tuple("SockProto::ProtoEightyfour").finish(),
            SockProto::ProtoEightyfive => f.debug_tuple("SockProto::ProtoEightyfive").finish(),
            SockProto::ProtoEightysix => f.debug_tuple("SockProto::ProtoEightysix").finish(),
            SockProto::ProtoEightyseven => f.debug_tuple("SockProto::ProtoEightyseven").finish(),
            SockProto::ProtoEightyeight => f.debug_tuple("SockProto::ProtoEightyeight").finish(),
            SockProto::ProtoEightynine => f.debug_tuple("SockProto::ProtoEightynine").finish(),
            SockProto::ProtoNinety => f.debug_tuple("SockProto::ProtoNinety").finish(),
            SockProto::ProtoNinetyone => f.debug_tuple("SockProto::ProtoNinetyone").finish(),
            SockProto::Mtp => f.debug_tuple("SockProto::Mtp").finish(),
            SockProto::ProtoNinetythree => f.debug_tuple("SockProto::ProtoNinetythree").finish(),
            SockProto::Beetph => f.debug_tuple("SockProto::Beetph").finish(),
            SockProto::ProtoNinetyfive => f.debug_tuple("SockProto::ProtoNinetyfive").finish(),
            SockProto::ProtoNinetysix => f.debug_tuple("SockProto::ProtoNinetysix").finish(),
            SockProto::ProtoNineetyseven => f.debug_tuple("SockProto::ProtoNineetyseven").finish(),
            SockProto::Encap => f.debug_tuple("SockProto::Encap").finish(),
            SockProto::ProtoNinetynine => f.debug_tuple("SockProto::ProtoNinetynine").finish(),
            SockProto::ProtoOnehundred => f.debug_tuple("SockProto::ProtoOnehundred").finish(),
            SockProto::ProtoOnehundredandone => {
                f.debug_tuple("SockProto::ProtoOnehundredandone").finish()
            }
            SockProto::ProtoOnehundredandtwo => {
                f.debug_tuple("SockProto::ProtoOnehundredandtwo").finish()
            }
            SockProto::Pim => f.debug_tuple("SockProto::Pim").finish(),
            SockProto::ProtoOnehundredandfour => {
                f.debug_tuple("SockProto::ProtoOnehundredandfour").finish()
            }
            SockProto::ProtoOnehundredandfive => {
                f.debug_tuple("SockProto::ProtoOnehundredandfive").finish()
            }
            SockProto::ProtoOnehundredandsix => {
                f.debug_tuple("SockProto::ProtoOnehundredandsix").finish()
            }
            SockProto::ProtoOnehundredandseven => {
                f.debug_tuple("SockProto::ProtoOnehundredandseven").finish()
            }
            SockProto::Comp => f.debug_tuple("SockProto::Comp").finish(),
            SockProto::ProtoOnehundredandnine => {
                f.debug_tuple("SockProto::ProtoOnehundredandnine").finish()
            }
            SockProto::ProtoOnehundredandten => {
                f.debug_tuple("SockProto::ProtoOnehundredandten").finish()
            }
            SockProto::ProtoOnehundredandeleven => f
                .debug_tuple("SockProto::ProtoOnehundredandeleven")
                .finish(),
            SockProto::ProtoOnehundredandtwelve => f
                .debug_tuple("SockProto::ProtoOnehundredandtwelve")
                .finish(),
            SockProto::ProtoOnehundredandthirteen => f
                .debug_tuple("SockProto::ProtoOnehundredandthirteen")
                .finish(),
            SockProto::ProtoOnehundredandfourteen => f
                .debug_tuple("SockProto::ProtoOnehundredandfourteen")
                .finish(),
            SockProto::ProtoOnehundredandfifteen => f
                .debug_tuple("SockProto::ProtoOnehundredandfifteen")
                .finish(),
            SockProto::ProtoOnehundredandsixteen => f
                .debug_tuple("SockProto::ProtoOnehundredandsixteen")
                .finish(),
            SockProto::ProtoOnehundredandseventeen => f
                .debug_tuple("SockProto::ProtoOnehundredandseventeen")
                .finish(),
            SockProto::ProtoOnehundredandeighteen => f
                .debug_tuple("SockProto::ProtoOnehundredandeighteen")
                .finish(),
            SockProto::ProtoOnehundredandnineteen => f
                .debug_tuple("SockProto::ProtoOnehundredandnineteen")
                .finish(),
            SockProto::ProtoOnehundredandtwenty => f
                .debug_tuple("SockProto::ProtoOnehundredandtwenty")
                .finish(),
            SockProto::ProtoOnehundredandtwentyone => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentyone")
                .finish(),
            SockProto::ProtoOnehundredandtwentytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentytwo")
                .finish(),
            SockProto::ProtoOnehundredandtwentythree => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentythree")
                .finish(),
            SockProto::ProtoOnehundredandtwentyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentyfour")
                .finish(),
            SockProto::ProtoOnehundredandtwentyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentyfive")
                .finish(),
            SockProto::ProtoOnehundredandtwentysix => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentysix")
                .finish(),
            SockProto::ProtoOnehundredandtwentyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentyseven")
                .finish(),
            SockProto::ProtoOnehundredandtwentyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentyeight")
                .finish(),
            SockProto::ProtoOnehundredandtwentynine => f
                .debug_tuple("SockProto::ProtoOnehundredandtwentynine")
                .finish(),
            SockProto::ProtoOnehundredandthirty => f
                .debug_tuple("SockProto::ProtoOnehundredandthirty")
                .finish(),
            SockProto::ProtoOnehundredandthirtyone => f
                .debug_tuple("SockProto::ProtoOnehundredandthirtyone")
                .finish(),
            SockProto::Sctp => f.debug_tuple("SockProto::Sctp").finish(),
            SockProto::ProtoOnehundredandthirtythree => f
                .debug_tuple("SockProto::ProtoOnehundredandthirtythree")
                .finish(),
            SockProto::ProtoOnehundredandthirtyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandthirtyfour")
                .finish(),
            SockProto::Mh => f.debug_tuple("SockProto::Mh").finish(),
            SockProto::Udplite => f.debug_tuple("SockProto::Udplite").finish(),
            SockProto::Mpls => f.debug_tuple("SockProto::Mpls").finish(),
            SockProto::ProtoOnehundredandthirtyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandthirtyeight")
                .finish(),
            SockProto::ProtoOnehundredandthirtynine => f
                .debug_tuple("SockProto::ProtoOnehundredandthirtynine")
                .finish(),
            SockProto::ProtoOnehundredandfourty => f
                .debug_tuple("SockProto::ProtoOnehundredandfourty")
                .finish(),
            SockProto::ProtoOnehundredandfourtyone => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtyone")
                .finish(),
            SockProto::ProtoOnehundredandfourtytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtytwo")
                .finish(),
            SockProto::Ethernet => f.debug_tuple("SockProto::Ethernet").finish(),
            SockProto::ProtoOnehundredandfourtyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtyfour")
                .finish(),
            SockProto::ProtoOnehundredandfourtyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtyfive")
                .finish(),
            SockProto::ProtoOnehundredandfourtysix => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtysix")
                .finish(),
            SockProto::ProtoOnehundredandfourtyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtyseven")
                .finish(),
            SockProto::ProtoOnehundredandfourtyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtyeight")
                .finish(),
            SockProto::ProtoOnehundredandfourtynine => f
                .debug_tuple("SockProto::ProtoOnehundredandfourtynine")
                .finish(),
            SockProto::ProtoOnehundredandfifty => {
                f.debug_tuple("SockProto::ProtoOnehundredandfifty").finish()
            }
            SockProto::ProtoOnehundredandfiftyone => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftyone")
                .finish(),
            SockProto::ProtoOnehundredandfiftytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftytwo")
                .finish(),
            SockProto::ProtoOnehundredandfiftythree => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftythree")
                .finish(),
            SockProto::ProtoOnehundredandfiftyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftyfour")
                .finish(),
            SockProto::ProtoOnehundredandfiftyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftyfive")
                .finish(),
            SockProto::ProtoOnehundredandfiftysix => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftysix")
                .finish(),
            SockProto::ProtoOnehundredandfiftyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftyseven")
                .finish(),
            SockProto::ProtoOnehundredandfiftyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftyeight")
                .finish(),
            SockProto::ProtoOnehundredandfiftynine => f
                .debug_tuple("SockProto::ProtoOnehundredandfiftynine")
                .finish(),
            SockProto::ProtoOnehundredandsixty => {
                f.debug_tuple("SockProto::ProtoOnehundredandsixty").finish()
            }
            SockProto::ProtoOnehundredandsixtyone => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtyone")
                .finish(),
            SockProto::ProtoOnehundredandsixtytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtytwo")
                .finish(),
            SockProto::ProtoOnehundredandsixtythree => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtythree")
                .finish(),
            SockProto::ProtoOnehundredandsixtyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtyfour")
                .finish(),
            SockProto::ProtoOnehundredandsixtyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtyfive")
                .finish(),
            SockProto::ProtoOnehundredandsixtysix => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtysix")
                .finish(),
            SockProto::ProtoOnehundredandsixtyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtyseven")
                .finish(),
            SockProto::ProtoOnehundredandsixtyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtyeight")
                .finish(),
            SockProto::ProtoOnehundredandsixtynine => f
                .debug_tuple("SockProto::ProtoOnehundredandsixtynine")
                .finish(),
            SockProto::ProtoOnehundredandseventy => f
                .debug_tuple("SockProto::ProtoOnehundredandseventy")
                .finish(),
            SockProto::ProtoOnehundredandseventyone => f
                .debug_tuple("SockProto::ProtoOnehundredandseventyone")
                .finish(),
            SockProto::ProtoOnehundredandseventytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandseventytwo")
                .finish(),
            SockProto::ProtoOnehundredandseventythree => f
                .debug_tuple("SockProto::ProtoOnehundredandseventythree")
                .finish(),
            SockProto::ProtoOnehundredandseventyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandseventyfour")
                .finish(),
            SockProto::ProtoOnehundredandseventyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandseventyfive")
                .finish(),
            SockProto::ProtoOnehundredandseventysix => f
                .debug_tuple("SockProto::ProtoOnehundredandseventysix")
                .finish(),
            SockProto::ProtoOnehundredandseventyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandseventyseven")
                .finish(),
            SockProto::ProtoOnehundredandseventyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandseventyeight")
                .finish(),
            SockProto::ProtoOnehundredandseventynine => f
                .debug_tuple("SockProto::ProtoOnehundredandseventynine")
                .finish(),
            SockProto::ProtoOnehundredandeighty => f
                .debug_tuple("SockProto::ProtoOnehundredandeighty")
                .finish(),
            SockProto::ProtoOnehundredandeightyone => f
                .debug_tuple("SockProto::ProtoOnehundredandeightyone")
                .finish(),
            SockProto::ProtoOnehundredandeightytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandeightytwo")
                .finish(),
            SockProto::ProtoOnehundredandeightythree => f
                .debug_tuple("SockProto::ProtoOnehundredandeightythree")
                .finish(),
            SockProto::ProtoOnehundredandeightyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandeightyfour")
                .finish(),
            SockProto::ProtoOnehundredandeightyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandeightyfive")
                .finish(),
            SockProto::ProtoOnehundredandeightysix => f
                .debug_tuple("SockProto::ProtoOnehundredandeightysix")
                .finish(),
            SockProto::ProtoOnehundredandeightyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandeightyseven")
                .finish(),
            SockProto::ProtoOnehundredandeightyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandeightyeight")
                .finish(),
            SockProto::ProtoOnehundredandeightynine => f
                .debug_tuple("SockProto::ProtoOnehundredandeightynine")
                .finish(),
            SockProto::ProtoOnehundredandninety => f
                .debug_tuple("SockProto::ProtoOnehundredandninety")
                .finish(),
            SockProto::ProtoOnehundredandninetyone => f
                .debug_tuple("SockProto::ProtoOnehundredandninetyone")
                .finish(),
            SockProto::ProtoOnehundredandninetytwo => f
                .debug_tuple("SockProto::ProtoOnehundredandninetytwo")
                .finish(),
            SockProto::ProtoOnehundredandninetythree => f
                .debug_tuple("SockProto::ProtoOnehundredandninetythree")
                .finish(),
            SockProto::ProtoOnehundredandninetyfour => f
                .debug_tuple("SockProto::ProtoOnehundredandninetyfour")
                .finish(),
            SockProto::ProtoOnehundredandninetyfive => f
                .debug_tuple("SockProto::ProtoOnehundredandninetyfive")
                .finish(),
            SockProto::ProtoOnehundredandninetysix => f
                .debug_tuple("SockProto::ProtoOnehundredandninetysix")
                .finish(),
            SockProto::ProtoOnehundredandninetyseven => f
                .debug_tuple("SockProto::ProtoOnehundredandninetyseven")
                .finish(),
            SockProto::ProtoOnehundredandninetyeight => f
                .debug_tuple("SockProto::ProtoOnehundredandninetyeight")
                .finish(),
            SockProto::ProtoOnehundredandninetynine => f
                .debug_tuple("SockProto::ProtoOnehundredandninetynine")
                .finish(),
            SockProto::ProtoTwohundred => f.debug_tuple("SockProto::ProtoTwohundred").finish(),
            SockProto::ProtoTwohundredandone => {
                f.debug_tuple("SockProto::ProtoTwohundredandone").finish()
            }
            SockProto::ProtoTwohundredandtwo => {
                f.debug_tuple("SockProto::ProtoTwohundredandtwo").finish()
            }
            SockProto::ProtoTwohundredandthree => {
                f.debug_tuple("SockProto::ProtoTwohundredandthree").finish()
            }
            SockProto::ProtoTwohundredandfour => {
                f.debug_tuple("SockProto::ProtoTwohundredandfour").finish()
            }
            SockProto::ProtoTwohundredandfive => {
                f.debug_tuple("SockProto::ProtoTwohundredandfive").finish()
            }
            SockProto::ProtoTwohundredandsix => {
                f.debug_tuple("SockProto::ProtoTwohundredandsix").finish()
            }
            SockProto::ProtoTwohundredandseven => {
                f.debug_tuple("SockProto::ProtoTwohundredandseven").finish()
            }
            SockProto::ProtoTwohundredandeight => {
                f.debug_tuple("SockProto::ProtoTwohundredandeight").finish()
            }
            SockProto::ProtoTwohundredandnine => {
                f.debug_tuple("SockProto::ProtoTwohundredandnine").finish()
            }
            SockProto::ProtoTwohundredandten => {
                f.debug_tuple("SockProto::ProtoTwohundredandten").finish()
            }
            SockProto::ProtoTwohundredandeleven => f
                .debug_tuple("SockProto::ProtoTwohundredandeleven")
                .finish(),
            SockProto::ProtoTwohundredandtwelve => f
                .debug_tuple("SockProto::ProtoTwohundredandtwelve")
                .finish(),
            SockProto::ProtoTwohundredandthirteen => f
                .debug_tuple("SockProto::ProtoTwohundredandthirteen")
                .finish(),
            SockProto::ProtoTwohundredandfourteen => f
                .debug_tuple("SockProto::ProtoTwohundredandfourteen")
                .finish(),
            SockProto::ProtoTwohundredandfifteen => f
                .debug_tuple("SockProto::ProtoTwohundredandfifteen")
                .finish(),
            SockProto::ProtoTwohundredandsixteen => f
                .debug_tuple("SockProto::ProtoTwohundredandsixteen")
                .finish(),
            SockProto::ProtoTwohundredandseventeen => f
                .debug_tuple("SockProto::ProtoTwohundredandseventeen")
                .finish(),
            SockProto::ProtoTwohundredandeighteen => f
                .debug_tuple("SockProto::ProtoTwohundredandeighteen")
                .finish(),
            SockProto::ProtoTwohundredandnineteen => f
                .debug_tuple("SockProto::ProtoTwohundredandnineteen")
                .finish(),
            SockProto::ProtoTwohundredandtwenty => f
                .debug_tuple("SockProto::ProtoTwohundredandtwenty")
                .finish(),
            SockProto::ProtoTwohundredandtwentyone => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentyone")
                .finish(),
            SockProto::ProtoTwohundredandtwentytwo => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentytwo")
                .finish(),
            SockProto::ProtoTwohundredandtwentythree => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentythree")
                .finish(),
            SockProto::ProtoTwohundredandtwentyfour => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentyfour")
                .finish(),
            SockProto::ProtoTwohundredandtwentyfive => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentyfive")
                .finish(),
            SockProto::ProtoTwohundredandtwentysix => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentysix")
                .finish(),
            SockProto::ProtoTwohundredandtwentyseven => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentyseven")
                .finish(),
            SockProto::ProtoTwohundredandtwentyeight => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentyeight")
                .finish(),
            SockProto::ProtoTwohundredandtwentynine => f
                .debug_tuple("SockProto::ProtoTwohundredandtwentynine")
                .finish(),
            SockProto::ProtoTwohundredandthirty => f
                .debug_tuple("SockProto::ProtoTwohundredandthirty")
                .finish(),
            SockProto::ProtoTwohundredandthirtyone => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtyone")
                .finish(),
            SockProto::ProtoTwohundredandthirtytwo => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtytwo")
                .finish(),
            SockProto::ProtoTwohundredandthirtythree => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtythree")
                .finish(),
            SockProto::ProtoTwohundredandthirtyfour => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtyfour")
                .finish(),
            SockProto::ProtoTwohundredandthirtyfive => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtyfive")
                .finish(),
            SockProto::ProtoTwohundredandthirtysix => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtysix")
                .finish(),
            SockProto::ProtoTwohundredandthirtyseven => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtyseven")
                .finish(),
            SockProto::ProtoTwohundredandthirtyeight => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtyeight")
                .finish(),
            SockProto::ProtoTwohundredandthirtynine => f
                .debug_tuple("SockProto::ProtoTwohundredandthirtynine")
                .finish(),
            SockProto::ProtoTwohundredandfourty => f
                .debug_tuple("SockProto::ProtoTwohundredandfourty")
                .finish(),
            SockProto::ProtoTwohundredandfourtyone => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtyone")
                .finish(),
            SockProto::ProtoTwohundredandfourtytwo => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtytwo")
                .finish(),
            SockProto::ProtoTwohundredandfourtythree => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtythree")
                .finish(),
            SockProto::ProtoTwohundredandfourtyfour => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtyfour")
                .finish(),
            SockProto::ProtoTwohundredandfourtyfive => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtyfive")
                .finish(),
            SockProto::ProtoTwohundredandfourtysix => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtysix")
                .finish(),
            SockProto::ProtoTwohundredandfourtyseven => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtyseven")
                .finish(),
            SockProto::ProtoTwohundredandfourtyeight => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtyeight")
                .finish(),
            SockProto::ProtoTwohundredandfourtynine => f
                .debug_tuple("SockProto::ProtoTwohundredandfourtynine")
                .finish(),
            SockProto::ProtoTwohundredandfifty => {
                f.debug_tuple("SockProto::ProtoTwohundredandfifty").finish()
            }
            SockProto::ProtoTwohundredandfiftyone => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftyone")
                .finish(),
            SockProto::ProtoTwohundredandfiftytwo => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftytwo")
                .finish(),
            SockProto::ProtoTwohundredandfiftythree => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftythree")
                .finish(),
            SockProto::ProtoTwohundredandfiftyfour => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftyfour")
                .finish(),
            SockProto::ProtoRaw => f.debug_tuple("SockProto::ProtoRaw").finish(),
            SockProto::ProtoTwohundredandfiftysix => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftysix")
                .finish(),
            SockProto::ProtoTwohundredandfiftyseven => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftyseven")
                .finish(),
            SockProto::ProtoTwohundredandfiftyeight => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftyeight")
                .finish(),
            SockProto::ProtoTwohundredandfiftynine => f
                .debug_tuple("SockProto::ProtoTwohundredandfiftynine")
                .finish(),
            SockProto::ProtoTwohundredandsixty => {
                f.debug_tuple("SockProto::ProtoTwohundredandsixty").finish()
            }
            SockProto::ProtoTwohundredandsixtyone => f
                .debug_tuple("SockProto::ProtoTwohundredandsixtyone")
                .finish(),
            SockProto::Mptcp => f.debug_tuple("SockProto::Mptcp").finish(),
            SockProto::Max => f.debug_tuple("SockProto::Max").finish(),
        }
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Bool {
    False,
    True,
}
impl core::fmt::Debug for Bool {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Bool::False => f.debug_tuple("Bool::False").finish(),
            Bool::True => f.debug_tuple("Bool::True").finish(),
        }
    }
}
impl core::fmt::Display for Bool {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Bool::False => write!(f, "false"),
            Bool::True => write!(f, "true"),
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct OptionTimestamp {
    pub tag: OptionTag,
    pub u: Timestamp,
}
impl core::fmt::Debug for OptionTimestamp {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("OptionTimestamp")
            .field("tag", &self.tag)
            .field("u", &self.u)
            .finish()
    }
}
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq, num_enum :: TryFromPrimitive, Hash)]
pub enum Signal {
    Signone = 0,
    Sighup,
    Sigint,
    Sigquit,
    Sigill,
    Sigtrap,
    Sigabrt,
    Sigbus,
    Sigfpe,
    Sigkill,
    Sigusr1,
    Sigsegv,
    Sigusr2,
    Sigpipe,
    Sigalrm,
    Sigterm,
    Sigstkflt,
    Sigchld,
    Sigcont,
    Sigstop,
    Sigtstp,
    Sigttin,
    Sigttou,
    Sigurg,
    Sigxcpu,
    Sigxfsz,
    Sigvtalrm,
    Sigprof,
    Sigwinch,
    Sigpoll,
    Sigpwr,
    Sigsys,
}
impl core::fmt::Debug for Signal {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Signal::Signone => f.debug_tuple("Signal::Signone").finish(),
            Signal::Sighup => f.debug_tuple("Signal::Sighup").finish(),
            Signal::Sigint => f.debug_tuple("Signal::Sigint").finish(),
            Signal::Sigquit => f.debug_tuple("Signal::Sigquit").finish(),
            Signal::Sigill => f.debug_tuple("Signal::Sigill").finish(),
            Signal::Sigtrap => f.debug_tuple("Signal::Sigtrap").finish(),
            Signal::Sigabrt => f.debug_tuple("Signal::Sigabrt").finish(),
            Signal::Sigbus => f.debug_tuple("Signal::Sigbus").finish(),
            Signal::Sigfpe => f.debug_tuple("Signal::Sigfpe").finish(),
            Signal::Sigkill => f.debug_tuple("Signal::Sigkill").finish(),
            Signal::Sigusr1 => f.debug_tuple("Signal::Sigusr1").finish(),
            Signal::Sigsegv => f.debug_tuple("Signal::Sigsegv").finish(),
            Signal::Sigusr2 => f.debug_tuple("Signal::Sigusr2").finish(),
            Signal::Sigpipe => f.debug_tuple("Signal::Sigpipe").finish(),
            Signal::Sigalrm => f.debug_tuple("Signal::Sigalrm").finish(),
            Signal::Sigterm => f.debug_tuple("Signal::Sigterm").finish(),
            Signal::Sigstkflt => f.debug_tuple("Signal::Sigstkflt").finish(),
            Signal::Sigchld => f.debug_tuple("Signal::Sigchld").finish(),
            Signal::Sigcont => f.debug_tuple("Signal::Sigcont").finish(),
            Signal::Sigstop => f.debug_tuple("Signal::Sigstop").finish(),
            Signal::Sigtstp => f.debug_tuple("Signal::Sigtstp").finish(),
            Signal::Sigttin => f.debug_tuple("Signal::Sigttin").finish(),
            Signal::Sigttou => f.debug_tuple("Signal::Sigttou").finish(),
            Signal::Sigurg => f.debug_tuple("Signal::Sigurg").finish(),
            Signal::Sigxcpu => f.debug_tuple("Signal::Sigxcpu").finish(),
            Signal::Sigxfsz => f.debug_tuple("Signal::Sigxfsz").finish(),
            Signal::Sigvtalrm => f.debug_tuple("Signal::Sigvtalrm").finish(),
            Signal::Sigprof => f.debug_tuple("Signal::Sigprof").finish(),
            Signal::Sigwinch => f.debug_tuple("Signal::Sigwinch").finish(),
            Signal::Sigpoll => f.debug_tuple("Signal::Sigpoll").finish(),
            Signal::Sigpwr => f.debug_tuple("Signal::Sigpwr").finish(),
            Signal::Sigsys => f.debug_tuple("Signal::Sigsys").finish(),
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct AddrUnspec {
    pub n0: u8,
}
impl core::fmt::Debug for AddrUnspec {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("AddrUnspec").field("n0", &self.n0).finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct AddrUnspecPort {
    pub port: u16,
    pub addr: AddrUnspec,
}
impl core::fmt::Debug for AddrUnspecPort {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("AddrUnspecPort")
            .field("port", &self.port)
            .field("addr", &self.addr)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CidrUnspec {
    pub addr: AddrUnspec,
    pub prefix: u8,
}
impl core::fmt::Debug for CidrUnspec {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("CidrUnspec")
            .field("addr", &self.addr)
            .field("prefix", &self.prefix)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct HttpHandles {
    pub req: Fd,
    pub res: Fd,
    pub hdr: Fd,
}
impl core::fmt::Debug for HttpHandles {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("HttpHandles")
            .field("req", &self.req)
            .field("res", &self.res)
            .field("hdr", &self.hdr)
            .finish()
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct HttpStatus {
    pub ok: Bool,
    pub redirect: Bool,
    pub size: Filesize,
    pub status: u16,
}
impl core::fmt::Debug for HttpStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("HttpStatus")
            .field("ok", &self.ok)
            .field("redirect", &self.redirect)
            .field("size", &self.size)
            .field("status", &self.status)
            .finish()
    }
}
pub type RiFlags = u16;
pub type RoFlags = u16;
pub type SdFlags = u8;
pub type SiFlags = u16;
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Timeout {
    Read,
    Write,
    Connect,
    Accept,
}
impl core::fmt::Debug for Timeout {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Timeout::Read => f.debug_tuple("Timeout::Read").finish(),
            Timeout::Write => f.debug_tuple("Timeout::Write").finish(),
            Timeout::Connect => f.debug_tuple("Timeout::Connect").finish(),
            Timeout::Accept => f.debug_tuple("Timeout::Accept").finish(),
        }
    }
}
wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " join flags."]
    pub struct JoinFlags : u32 {
        #[doc = " Non-blocking join on the process"]
        const NON_BLOCKING = 1 << 0 ;
        #[doc = " Return if a process is stopped"]
        const WAKE_STOPPED = 1 << 1 ;
    }
}
impl JoinFlags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u32) -> Self {
        Self { bits }
    }
}
#[doc = " What has happened with the proccess when we joined on it"]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum JoinStatusType {
    #[doc = " Nothing has happened"]
    Nothing,
    #[doc = " The process has exited by a normal exit code"]
    ExitNormal,
    #[doc = " The process was terminated by a signal"]
    ExitSignal,
    #[doc = " The process was stopped by a signal and can be resumed with SIGCONT"]
    Stopped,
}
impl core::fmt::Debug for JoinStatusType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            JoinStatusType::Nothing => f.debug_tuple("JoinStatusType::Nothing").finish(),
            JoinStatusType::ExitNormal => f.debug_tuple("JoinStatusType::ExitNormal").finish(),
            JoinStatusType::ExitSignal => f.debug_tuple("JoinStatusType::ExitSignal").finish(),
            JoinStatusType::Stopped => f.debug_tuple("JoinStatusType::Stopped").finish(),
        }
    }
}
#[doc = " Represents an errno and a signal"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ErrnoSignal {
    #[doc = " The exit code that was returned"]
    pub exit_code: Errno,
    #[doc = " The signal that was returned"]
    pub signal: Signal,
}
impl core::fmt::Debug for ErrnoSignal {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("ErrnoSignal")
            .field("exit-code", &self.exit_code)
            .field("signal", &self.signal)
            .finish()
    }
}

wai_bindgen_rust::bitflags::bitflags! {
    #[doc = " thread state flags"]
    pub struct ThreadStateFlags : u16 {
        const TSD_USED = 1 << 0 ;
        const DLERROR_FLAG = 1 << 1 ;
    }
}
impl ThreadStateFlags {
    #[doc = " Convert from a raw integer, preserving any unknown bits. See"]
    #[doc = " <https://github.com/bitflags/bitflags/issues/263#issuecomment-957088321>"]
    pub fn from_bits_preserve(bits: u16) -> Self {
        Self { bits }
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Snapshot0Clockid {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Snapshot0Clockid {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Realtime,
            1 => Self::Monotonic,
            2 => Self::ProcessCputimeId,
            3 => Self::ThreadCputimeId,

            q => todo!("could not serialize number {q} to enum Snapshot0Clockid"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Clockid {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Clockid {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Realtime,
            1 => Self::Monotonic,
            2 => Self::ProcessCputimeId,
            3 => Self::ThreadCputimeId,

            q => todo!("could not serialize number {q} to enum Clockid"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Errno {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Errno {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Success,
            1 => Self::Toobig,
            2 => Self::Access,
            3 => Self::Addrinuse,
            4 => Self::Addrnotavail,
            5 => Self::Afnosupport,
            6 => Self::Again,
            7 => Self::Already,
            8 => Self::Badf,
            9 => Self::Badmsg,
            10 => Self::Busy,
            11 => Self::Canceled,
            12 => Self::Child,
            13 => Self::Connaborted,
            14 => Self::Connrefused,
            15 => Self::Connreset,
            16 => Self::Deadlk,
            17 => Self::Destaddrreq,
            18 => Self::Dom,
            19 => Self::Dquot,
            20 => Self::Exist,
            21 => Self::Fault,
            22 => Self::Fbig,
            23 => Self::Hostunreach,
            24 => Self::Idrm,
            25 => Self::Ilseq,
            26 => Self::Inprogress,
            27 => Self::Intr,
            28 => Self::Inval,
            29 => Self::Io,
            30 => Self::Isconn,
            31 => Self::Isdir,
            32 => Self::Loop,
            33 => Self::Mfile,
            34 => Self::Mlink,
            35 => Self::Msgsize,
            36 => Self::Multihop,
            37 => Self::Nametoolong,
            38 => Self::Netdown,
            39 => Self::Netreset,
            40 => Self::Netunreach,
            41 => Self::Nfile,
            42 => Self::Nobufs,
            43 => Self::Nodev,
            44 => Self::Noent,
            45 => Self::Noexec,
            46 => Self::Nolck,
            47 => Self::Nolink,
            48 => Self::Nomem,
            49 => Self::Nomsg,
            50 => Self::Noprotoopt,
            51 => Self::Nospc,
            52 => Self::Nosys,
            53 => Self::Notconn,
            54 => Self::Notdir,
            55 => Self::Notempty,
            56 => Self::Notrecoverable,
            57 => Self::Notsock,
            58 => Self::Notsup,
            59 => Self::Notty,
            60 => Self::Nxio,
            61 => Self::Overflow,
            62 => Self::Ownerdead,
            63 => Self::Perm,
            64 => Self::Pipe,
            65 => Self::Proto,
            66 => Self::Protonosupport,
            67 => Self::Prototype,
            68 => Self::Range,
            69 => Self::Rofs,
            70 => Self::Spipe,
            71 => Self::Srch,
            72 => Self::Stale,
            73 => Self::Timedout,
            74 => Self::Txtbsy,
            75 => Self::Xdev,
            76 => Self::Notcapable,
            77 => Self::Shutdown,
            78 => Self::Memviolation,
            79 => Self::Unknown,

            _ => Self::Unknown,
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Rights {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Filetype {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Filetype {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Unknown,
            1 => Self::BlockDevice,
            2 => Self::CharacterDevice,
            3 => Self::Directory,
            4 => Self::RegularFile,
            5 => Self::SocketDgram,
            6 => Self::SocketStream,
            7 => Self::SymbolicLink,
            8 => Self::SocketRaw,
            9 => Self::SocketSeqpacket,

            q => todo!("could not serialize number {q} to enum Filetype"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Snapshot0Dirent {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Dirent {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Advice {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Advice {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Normal,
            1 => Self::Sequential,
            2 => Self::Random,
            3 => Self::Willneed,
            4 => Self::Dontneed,
            5 => Self::Noreuse,

            q => todo!("could not serialize number {q} to enum Advice"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Fdflags {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Fdstat {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Fstflags {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Lookup {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Oflags {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Eventtype {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Eventtype {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Clock,
            1 => Self::FdRead,
            2 => Self::FdWrite,

            q => todo!("could not serialize number {q} to enum Eventtype"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Subclockflags {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Snapshot0SubscriptionClock {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for SubscriptionClock {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Preopentype {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Preopentype {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Dir,

            q => todo!("could not serialize number {q} to enum Preopentype"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Eventrwflags {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for EventFdReadwrite {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for SubscriptionFsReadwrite {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Socktype {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Socktype {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Dgram,
            1 => Self::Stream,
            2 => Self::Raw,
            3 => Self::Seqpacket,

            q => todo!("could not serialize number {q} to enum Socktype"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Sockstatus {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Sockstatus {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Opening,
            1 => Self::Opened,
            2 => Self::Closed,
            3 => Self::Failed,

            q => todo!("could not serialize number {q} to enum Sockstatus"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Sockoption {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Sockoption {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Noop,
            1 => Self::ReusePort,
            2 => Self::ReuseAddr,
            3 => Self::NoDelay,
            4 => Self::DontRoute,
            5 => Self::OnlyV6,
            6 => Self::Broadcast,
            7 => Self::MulticastLoopV4,
            8 => Self::MulticastLoopV6,
            9 => Self::Promiscuous,
            10 => Self::Listening,
            11 => Self::LastError,
            12 => Self::KeepAlive,
            13 => Self::Linger,
            14 => Self::OobInline,
            15 => Self::RecvBufSize,
            16 => Self::SendBufSize,
            17 => Self::RecvLowat,
            18 => Self::SendLowat,
            19 => Self::RecvTimeout,
            20 => Self::SendTimeout,
            21 => Self::ConnectTimeout,
            22 => Self::AcceptTimeout,
            23 => Self::Ttl,
            24 => Self::MulticastTtlV4,
            25 => Self::Type,
            26 => Self::Proto,

            q => todo!("could not serialize number {q} to enum Sockoption"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Streamsecurity {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Streamsecurity {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Unencrypted,
            1 => Self::AnyEncryption,
            2 => Self::ClassicEncryption,
            3 => Self::DoubleEncryption,

            q => todo!("could not serialize number {q} to enum Streamsecurity"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Addressfamily {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Addressfamily {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Unspec,
            1 => Self::Inet4,
            2 => Self::Inet6,
            3 => Self::Unix,

            q => todo!("could not serialize number {q} to enum Addressfamily"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Snapshot0Filestat {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Filestat {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Snapshot0Whence {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Snapshot0Whence {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Cur,
            1 => Self::End,
            2 => Self::Set,

            q => todo!("could not serialize number {q} to enum Snapshot0Whence"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Whence {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Whence {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Set,
            1 => Self::Cur,
            2 => Self::End,

            q => todo!("could not serialize number {q} to enum Whence"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Tty {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for OptionTag {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for OptionTag {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::None,
            1 => Self::Some,

            q => todo!("could not serialize number {q} to enum OptionTag"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for OptionPid {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for ProcessHandles {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for OptionFd {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for PrestatUDir {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for PrestatU {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for PipeHandles {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for StdioMode {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for StdioMode {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Reserved,
            1 => Self::Piped,
            2 => Self::Inherit,
            3 => Self::Null,
            4 => Self::Log,

            q => todo!("could not serialize number {q} to enum StdioMode"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for SockProto {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for SockProto {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Ip,
            1 => Self::Icmp,
            2 => Self::Igmp,
            3 => Self::ProtoThree,
            4 => Self::Ipip,
            5 => Self::ProtoFive,
            6 => Self::Tcp,
            7 => Self::ProtoSeven,
            8 => Self::Egp,
            9 => Self::ProtoNine,
            10 => Self::ProtoTen,
            11 => Self::ProtoEleven,
            12 => Self::Pup,
            13 => Self::ProtoThirteen,
            14 => Self::ProtoFourteen,
            15 => Self::ProtoFifteen,
            16 => Self::ProtoSixteen,
            17 => Self::Udp,
            18 => Self::ProtoEighteen,
            19 => Self::ProtoNineteen,
            20 => Self::ProtoTwenty,
            21 => Self::ProtoTwentyone,
            22 => Self::Idp,
            23 => Self::ProtoTwentythree,
            24 => Self::ProtoTwentyfour,
            25 => Self::ProtoTwentyfive,
            26 => Self::ProtoTwentysix,
            27 => Self::ProtoTwentyseven,
            28 => Self::ProtoTwentyeight,
            29 => Self::ProtoTp,
            30 => Self::ProtoThirty,
            31 => Self::ProtoThirtyone,
            32 => Self::ProtoThirtytwo,
            33 => Self::Dccp,
            34 => Self::ProtoThirtyfour,
            35 => Self::ProtoThirtyfive,
            36 => Self::ProtoThirtysix,
            37 => Self::ProtoThirtyseven,
            38 => Self::ProtoThirtyeight,
            39 => Self::ProtoThirtynine,
            40 => Self::ProtoFourty,
            41 => Self::Ipv6,
            42 => Self::ProtoFourtytwo,
            43 => Self::Routing,
            44 => Self::Fragment,
            45 => Self::ProtoFourtyfive,
            46 => Self::Rsvp,
            47 => Self::Gre,
            48 => Self::ProtoFourtyeight,
            49 => Self::ProtoFourtynine,
            50 => Self::Esp,
            51 => Self::Ah,
            52 => Self::ProtoFiftytwo,
            53 => Self::ProtoFiftythree,
            54 => Self::ProtoFiftyfour,
            55 => Self::ProtoFiftyfive,
            56 => Self::ProtoFiftysix,
            57 => Self::ProtoFiftyseven,
            58 => Self::Icmpv6,
            59 => Self::None,
            60 => Self::Dstopts,
            61 => Self::ProtoSixtyone,
            62 => Self::ProtoSixtytwo,
            63 => Self::ProtoSixtythree,
            64 => Self::ProtoSixtyfour,
            65 => Self::ProtoSixtyfive,
            66 => Self::ProtoSixtysix,
            67 => Self::ProtoSixtyseven,
            68 => Self::ProtoSixtyeight,
            69 => Self::ProtoSixtynine,
            70 => Self::ProtoSeventy,
            71 => Self::ProtoSeventyone,
            72 => Self::ProtoSeventytwo,
            73 => Self::ProtoSeventythree,
            74 => Self::ProtoSeventyfour,
            75 => Self::ProtoSeventyfive,
            76 => Self::ProtoSeventysix,
            77 => Self::ProtoSeventyseven,
            78 => Self::ProtoSeventyeight,
            79 => Self::ProtoSeventynine,
            80 => Self::ProtoEighty,
            81 => Self::ProtoEightyone,
            82 => Self::ProtoEightytwo,
            83 => Self::ProtoEightythree,
            84 => Self::ProtoEightyfour,
            85 => Self::ProtoEightyfive,
            86 => Self::ProtoEightysix,
            87 => Self::ProtoEightyseven,
            88 => Self::ProtoEightyeight,
            89 => Self::ProtoEightynine,
            90 => Self::ProtoNinety,
            91 => Self::ProtoNinetyone,
            92 => Self::Mtp,
            93 => Self::ProtoNinetythree,
            94 => Self::Beetph,
            95 => Self::ProtoNinetyfive,
            96 => Self::ProtoNinetysix,
            97 => Self::ProtoNineetyseven,
            98 => Self::Encap,
            99 => Self::ProtoNinetynine,
            100 => Self::ProtoOnehundred,
            101 => Self::ProtoOnehundredandone,
            102 => Self::ProtoOnehundredandtwo,
            103 => Self::Pim,
            104 => Self::ProtoOnehundredandfour,
            105 => Self::ProtoOnehundredandfive,
            106 => Self::ProtoOnehundredandsix,
            107 => Self::ProtoOnehundredandseven,
            108 => Self::Comp,
            109 => Self::ProtoOnehundredandnine,
            110 => Self::ProtoOnehundredandten,
            111 => Self::ProtoOnehundredandeleven,
            112 => Self::ProtoOnehundredandtwelve,
            113 => Self::ProtoOnehundredandthirteen,
            114 => Self::ProtoOnehundredandfourteen,
            115 => Self::ProtoOnehundredandfifteen,
            116 => Self::ProtoOnehundredandsixteen,
            117 => Self::ProtoOnehundredandseventeen,
            118 => Self::ProtoOnehundredandeighteen,
            119 => Self::ProtoOnehundredandnineteen,
            120 => Self::ProtoOnehundredandtwenty,
            121 => Self::ProtoOnehundredandtwentyone,
            122 => Self::ProtoOnehundredandtwentytwo,
            123 => Self::ProtoOnehundredandtwentythree,
            124 => Self::ProtoOnehundredandtwentyfour,
            125 => Self::ProtoOnehundredandtwentyfive,
            126 => Self::ProtoOnehundredandtwentysix,
            127 => Self::ProtoOnehundredandtwentyseven,
            128 => Self::ProtoOnehundredandtwentyeight,
            129 => Self::ProtoOnehundredandtwentynine,
            130 => Self::ProtoOnehundredandthirty,
            131 => Self::ProtoOnehundredandthirtyone,
            132 => Self::Sctp,
            133 => Self::ProtoOnehundredandthirtythree,
            134 => Self::ProtoOnehundredandthirtyfour,
            135 => Self::Mh,
            136 => Self::Udplite,
            137 => Self::Mpls,
            138 => Self::ProtoOnehundredandthirtyeight,
            139 => Self::ProtoOnehundredandthirtynine,
            140 => Self::ProtoOnehundredandfourty,
            141 => Self::ProtoOnehundredandfourtyone,
            142 => Self::ProtoOnehundredandfourtytwo,
            143 => Self::Ethernet,
            144 => Self::ProtoOnehundredandfourtyfour,
            145 => Self::ProtoOnehundredandfourtyfive,
            146 => Self::ProtoOnehundredandfourtysix,
            147 => Self::ProtoOnehundredandfourtyseven,
            148 => Self::ProtoOnehundredandfourtyeight,
            149 => Self::ProtoOnehundredandfourtynine,
            150 => Self::ProtoOnehundredandfifty,
            151 => Self::ProtoOnehundredandfiftyone,
            152 => Self::ProtoOnehundredandfiftytwo,
            153 => Self::ProtoOnehundredandfiftythree,
            154 => Self::ProtoOnehundredandfiftyfour,
            155 => Self::ProtoOnehundredandfiftyfive,
            156 => Self::ProtoOnehundredandfiftysix,
            157 => Self::ProtoOnehundredandfiftyseven,
            158 => Self::ProtoOnehundredandfiftyeight,
            159 => Self::ProtoOnehundredandfiftynine,
            160 => Self::ProtoOnehundredandsixty,
            161 => Self::ProtoOnehundredandsixtyone,
            162 => Self::ProtoOnehundredandsixtytwo,
            163 => Self::ProtoOnehundredandsixtythree,
            164 => Self::ProtoOnehundredandsixtyfour,
            165 => Self::ProtoOnehundredandsixtyfive,
            166 => Self::ProtoOnehundredandsixtysix,
            167 => Self::ProtoOnehundredandsixtyseven,
            168 => Self::ProtoOnehundredandsixtyeight,
            169 => Self::ProtoOnehundredandsixtynine,
            170 => Self::ProtoOnehundredandseventy,
            171 => Self::ProtoOnehundredandseventyone,
            172 => Self::ProtoOnehundredandseventytwo,
            173 => Self::ProtoOnehundredandseventythree,
            174 => Self::ProtoOnehundredandseventyfour,
            175 => Self::ProtoOnehundredandseventyfive,
            176 => Self::ProtoOnehundredandseventysix,
            177 => Self::ProtoOnehundredandseventyseven,
            178 => Self::ProtoOnehundredandseventyeight,
            179 => Self::ProtoOnehundredandseventynine,
            180 => Self::ProtoOnehundredandeighty,
            181 => Self::ProtoOnehundredandeightyone,
            182 => Self::ProtoOnehundredandeightytwo,
            183 => Self::ProtoOnehundredandeightythree,
            184 => Self::ProtoOnehundredandeightyfour,
            185 => Self::ProtoOnehundredandeightyfive,
            186 => Self::ProtoOnehundredandeightysix,
            187 => Self::ProtoOnehundredandeightyseven,
            188 => Self::ProtoOnehundredandeightyeight,
            189 => Self::ProtoOnehundredandeightynine,
            190 => Self::ProtoOnehundredandninety,
            191 => Self::ProtoOnehundredandninetyone,
            192 => Self::ProtoOnehundredandninetytwo,
            193 => Self::ProtoOnehundredandninetythree,
            194 => Self::ProtoOnehundredandninetyfour,
            195 => Self::ProtoOnehundredandninetyfive,
            196 => Self::ProtoOnehundredandninetysix,
            197 => Self::ProtoOnehundredandninetyseven,
            198 => Self::ProtoOnehundredandninetyeight,
            199 => Self::ProtoOnehundredandninetynine,
            200 => Self::ProtoTwohundred,
            201 => Self::ProtoTwohundredandone,
            202 => Self::ProtoTwohundredandtwo,
            203 => Self::ProtoTwohundredandthree,
            204 => Self::ProtoTwohundredandfour,
            205 => Self::ProtoTwohundredandfive,
            206 => Self::ProtoTwohundredandsix,
            207 => Self::ProtoTwohundredandseven,
            208 => Self::ProtoTwohundredandeight,
            209 => Self::ProtoTwohundredandnine,
            210 => Self::ProtoTwohundredandten,
            211 => Self::ProtoTwohundredandeleven,
            212 => Self::ProtoTwohundredandtwelve,
            213 => Self::ProtoTwohundredandthirteen,
            214 => Self::ProtoTwohundredandfourteen,
            215 => Self::ProtoTwohundredandfifteen,
            216 => Self::ProtoTwohundredandsixteen,
            217 => Self::ProtoTwohundredandseventeen,
            218 => Self::ProtoTwohundredandeighteen,
            219 => Self::ProtoTwohundredandnineteen,
            220 => Self::ProtoTwohundredandtwenty,
            221 => Self::ProtoTwohundredandtwentyone,
            222 => Self::ProtoTwohundredandtwentytwo,
            223 => Self::ProtoTwohundredandtwentythree,
            224 => Self::ProtoTwohundredandtwentyfour,
            225 => Self::ProtoTwohundredandtwentyfive,
            226 => Self::ProtoTwohundredandtwentysix,
            227 => Self::ProtoTwohundredandtwentyseven,
            228 => Self::ProtoTwohundredandtwentyeight,
            229 => Self::ProtoTwohundredandtwentynine,
            230 => Self::ProtoTwohundredandthirty,
            231 => Self::ProtoTwohundredandthirtyone,
            232 => Self::ProtoTwohundredandthirtytwo,
            233 => Self::ProtoTwohundredandthirtythree,
            234 => Self::ProtoTwohundredandthirtyfour,
            235 => Self::ProtoTwohundredandthirtyfive,
            236 => Self::ProtoTwohundredandthirtysix,
            237 => Self::ProtoTwohundredandthirtyseven,
            238 => Self::ProtoTwohundredandthirtyeight,
            239 => Self::ProtoTwohundredandthirtynine,
            240 => Self::ProtoTwohundredandfourty,
            241 => Self::ProtoTwohundredandfourtyone,
            242 => Self::ProtoTwohundredandfourtytwo,
            243 => Self::ProtoTwohundredandfourtythree,
            244 => Self::ProtoTwohundredandfourtyfour,
            245 => Self::ProtoTwohundredandfourtyfive,
            246 => Self::ProtoTwohundredandfourtysix,
            247 => Self::ProtoTwohundredandfourtyseven,
            248 => Self::ProtoTwohundredandfourtyeight,
            249 => Self::ProtoTwohundredandfourtynine,
            250 => Self::ProtoTwohundredandfifty,
            251 => Self::ProtoTwohundredandfiftyone,
            252 => Self::ProtoTwohundredandfiftytwo,
            253 => Self::ProtoTwohundredandfiftythree,
            254 => Self::ProtoTwohundredandfiftyfour,
            255 => Self::ProtoRaw,
            256 => Self::ProtoTwohundredandfiftysix,
            257 => Self::ProtoTwohundredandfiftyseven,
            258 => Self::ProtoTwohundredandfiftyeight,
            259 => Self::ProtoTwohundredandfiftynine,
            260 => Self::ProtoTwohundredandsixty,
            261 => Self::ProtoTwohundredandsixtyone,
            262 => Self::Mptcp,
            263 => Self::Max,

            q => todo!("could not serialize number {q} to enum SockProto"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Bool {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Bool {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::False,
            1 => Self::True,

            q => todo!("could not serialize number {q} to enum Bool"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for OptionTimestamp {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Signal {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Signal {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Signone,
            1 => Self::Sighup,
            2 => Self::Sigint,
            3 => Self::Sigquit,
            4 => Self::Sigill,
            5 => Self::Sigtrap,
            6 => Self::Sigabrt,
            7 => Self::Sigbus,
            8 => Self::Sigfpe,
            9 => Self::Sigkill,
            10 => Self::Sigusr1,
            11 => Self::Sigsegv,
            12 => Self::Sigusr2,
            13 => Self::Sigpipe,
            14 => Self::Sigalrm,
            15 => Self::Sigterm,
            16 => Self::Sigstkflt,
            17 => Self::Sigchld,
            18 => Self::Sigcont,
            19 => Self::Sigstop,
            20 => Self::Sigtstp,
            21 => Self::Sigttin,
            22 => Self::Sigttou,
            23 => Self::Sigurg,
            24 => Self::Sigxcpu,
            25 => Self::Sigxfsz,
            26 => Self::Sigvtalrm,
            27 => Self::Sigprof,
            28 => Self::Sigwinch,
            29 => Self::Sigpoll,
            30 => Self::Sigpwr,
            31 => Self::Sigsys,

            _ => Self::Signone,
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for AddrUnspec {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for AddrUnspecPort {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for CidrUnspec {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for HttpHandles {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for HttpStatus {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for Timeout {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for Timeout {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Read,
            1 => Self::Write,
            2 => Self::Connect,
            3 => Self::Accept,

            q => todo!("could not serialize number {q} to enum Timeout"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for JoinFlags {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for JoinStatusType {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}

unsafe impl wasmer::FromToNativeWasmType for JoinStatusType {
    type Native = i32;

    fn to_native(self) -> Self::Native {
        self as i32
    }

    fn from_native(n: Self::Native) -> Self {
        match n {
            0 => Self::Nothing,
            1 => Self::ExitNormal,
            2 => Self::ExitSignal,
            3 => Self::Stopped,

            q => todo!("could not serialize number {q} to enum JoinStatusType"),
        }
    }

    fn is_from_store(&self, _store: &impl wasmer::AsStoreRef) -> bool {
        false
    }
}

// TODO: if necessary, must be implemented in wit-bindgen
unsafe impl ValueType for ErrnoSignal {
    #[inline]
    fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit<u8>]) {}
}