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
{
"crate_groups": [
{
"slug": "common",
"name": "Common",
"description": "Very commonly used crates that everyone should know about",
"subgroups": [
{
"slug": "general",
"name": "General",
"description": "General purpose ",
"purposes": [
{
"name": "Random numbers",
"recommendations": [{
"name": "rand",
"notes": "De facto standard random number generation library split out from the standard library"
}, {
"name": "fastrand",
"notes": "A simple and fast random number generator (but not cryptographically secure)."
}]
},
{
"name": "Time & Date",
"notes": "Unfortunately there is no clear answer as to which is best between time and chrono.<br />Evaluate for yourself between these two, but be resassured that both are trusted and well-maintained.",
"recommendations": [{
"name": "time",
"notes": "A smaller, simpler library. Preferable if covers your needs, but it's quite limited in what it provides."
}, {
"name": "chrono",
"notes": "The most comprehensive and full-featured datetime library, but more complex because of it."
}]
},
{
"name": "Regular Expressions",
"recommendations": [{
"name": "regex",
"notes": "De facto standard regex library. Very fast, but does not support fancier features such as backtracking."
},
{
"name": "fancy-regex",
"notes": "Use if need features such as backtracking which regex doesn't support"
}]
},
{
"name": "UUIDs",
"recommendations": [{
"name": "uuid",
"notes": "Implements generating and parsing UUIDs and a number of utility functions"
}]
},
{
"name": "Temporary files",
"recommendations": [{
"name": "tempfile",
"notes": "Supports both temporary files and temporary directories"
}]
},
{
"name": "Gzip (de)compression",
"recommendations": [{
"name": "flate2",
"notes": "Uses a pure-Rust implementation by default. Use feature flags to opt in to system zlib."
}]
},
{
"name": "Insertion-ordered map",
"recommendations": [{
"name": "indexmap",
"notes": "A HashMap that separately keeps track of insertion order and allows you to efficiently iterate over its elements in that order"
}]
},
{
"name": "Stack-allocated arrays",
"recommendations": [{
"name": "arrayvec",
"notes": "Arrays that are ONLY stack-allocated with fixed capacity"
}, {
"name": "smallvec",
"notes": "Arrays that are stack-allocated with fallback to the heap if the fixed stack capacity is exceeded"
}, {
"name": "tinyvec",
"notes": "Stack allocated arrays in 100% safe Rust code but requires items to implement the Default trait."
}]
},
{
"name": "HTTP Requests",
"notes": "See the HTTP section below for server-side libraries",
"recommendations": [{
"name": "reqwest",
"notes": "Full-fat HTTP client. Can be used in both synchronous and asynchronous code. Requires tokio runtime."
}, {
"name": "ureq",
"notes": "Minimal synchronous HTTP client focussed on simplicity and minimising dependencies."
}]
}
]
},
{
"slug": "error-handling",
"name": "Error Handling",
"description": "Crates for more easily handling errors",
"purposes": [
{
"name": "For applications",
"recommendations": [{
"name": "anyhow",
"notes": "Provides a boxed error type that can hold any error, and helpers for generating an application-level stack trace."
}, {
"name": "color-eyre",
"notes": "A fork of anyhow that gives you more control over the format of the generated error messages. Recommended if you intend to present error messages to end users. Otherwise anyhow is simpler."
}]
},
{
"name": "For libraries",
"notes": "See also: <a href=\"https://mmapped.blog/posts/12-rust-error-handling.html\">Designing error types in Rust</a>",
"recommendations": [{
"name": "thiserror",
"notes": "Helps with generating boilerplate for enum-style error types."
}]
}
]
},
{
"slug": "logging",
"name": "Logging",
"description": "Crates for logging. Note that in general you will need a separate crate for actually printing/storing the logs",
"purposes": [
{
"name": "Text-based logging",
"recommendations": [{
"name": "tracing",
"notes": "Tracing is now the go-to crate for logging."
}, {
"name": "log",
"notes": "An older and simpler crate if your needs are simple and you are not using any async code."
}]
},
{
"name": "Structured logging",
"recommendations": [{
"name": "tracing",
"notes": "Tracing is now the go-to crate for logging."
}, {
"name": "slog",
"notes": "Structured logging"
}]
}
]
},
{
"slug": "lang-extensions",
"name": "Language Extensions",
"description": "General purpose utility crates that extend language and/or stdlib functionality.",
"purposes": [
{
"name": "Lazy static variable initialization",
"notes": "This functionality is now <a href=\"https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html\">included in the standard library</a>",
"recommendations": [{
"name": "once_cell",
"notes": "Newer crate with more ergonomic API. Has since been adopted into the std library"
}, {
"name": "lazy_static",
"notes": "Older crate. API is less convenient, but crate is stable and maintained."
}]
},
{
"name": "Iterator helpers",
"recommendations": [{
"name": "itertools",
"notes": "A bunch of useful methods on iterators that aren't in the stdlib"
}]
},
{
"name": "Macro helpers",
"recommendations": [{
"name": "syn",
"notes": "Parse rust source code"
}, {
"name": "quote",
"notes": "Quasi quoting rust (useful for interpolating generated code with literal code)"
}, {
"name": "paste",
"notes": "Concatenating and manipulating identifiers"
}, {
"name": "darling",
"notes": "Derive macro to easily parse derive macro inputs"
}]
},
{
"name": "Safe type casts",
"recommendations": [{
"name": "bytemuck"
}, {
"name": "zerocopy"
}]
},
{
"name": "Bitflags",
"recommendations": [{
"name": "bitflags",
"notes": "Strongly typed bitflag types"
}]
}
]
},
{
"slug": "serialization",
"name": "Serialization",
"description": "Encode/decode between in-memory representations and general-purpose wire formats",
"purposes": [
{
"name": "General-purpose / format agnostic",
"recommendations": [{
"name": "serde",
"notes": "De facto standard serialization library. Use in conjunction with sub-crates like `serde_json` for the specific format that you are using (JSON, YAML, etc). Supports a variety of both text and binary protocols, including self-describing ones."
}]
},
{
"name": "Non-self-describing, external schema file",
"recommendations": [{
"name": "prost",
"notes": "Protocol buffer library with strong ergonomics and wide industry adoption. Commonly used with gRPC / `tonic`. Use in conjunction with `protox` to avoid dependency on `protoc`."
}, {
"name": "capnp",
"notes": "Cap'n Proto library. Offers zero-copy usage mode that is optimal for large messages, along with other improvements over Protocol Buffers. Tradeoffs are less wide usage and less developer-friendly."
}, {
"name": "flatbuffers",
"notes": "Flatbuffers library. Also offers zero-copy usage and is more widely used than cap'n proto, with further cost to ergonomics."
}]
},
{
"name": "Non-self-describing, no external schema file",
"recommendations": [{
"name": "postcard",
"notes": "<code>no_std</code> focused Serde serializer/deserializer, aimed at constrained environments."
}, {
"name": "rkyv",
"notes": "Fast zero-copy deserialization framework that allows arbitrary field types and safe zero-copy mutation."
}]
}]
},
{
"slug": "system",
"name": "System",
"description": "For low-level interaction with the underling platform / operating system",
"purposes": [
{
"name": "Memory mapping files",
"recommendations": [{
"name": "memmap2",
"notes": "The older memmap crate is unmaintained."
}]
},
{
"name": "Libc",
"recommendations": [{
"name": "libc",
"notes": "Bindings for directly calling libc functions."
}]
},
{
"name": "Windows (OS)",
"recommendations": [{
"name": "windows",
"notes": "The official Microsoft-provided crate for interacting with windows APIs"
}]
},
{
"name": "*nix (OSs)",
"recommendations": [{
"name": "rustix",
"notes": "Efficient and safe POSIX / *nix / Winsock syscall-like APIs. It uses idiomatic Rust types: refs, slices, Results instead of raw pointers, safe wrappers around raw file descriptors, bitflags instead of bare integer flags, and several other conveniences."
}, {
"name": "nix",
"notes": "Bindings to the various *nix system functions. (Unix, Linux, MacOS, etc.)"
}]
}
]
},
{
"slug": "tooling",
"name": "Tooling",
"description": "Developer tools for working with Rust projects.",
"subgroups": [],
"purposes": [
{
"name": "Toolchain Management",
"recommendations": [{
"name": "rustup",
"link": "https://rustup.rs",
"docs": "https://rust-lang.github.io/rustup",
"notes": "Install, manage, and upgrade versions of rustc, cargo, clippy, rustfmt and more."
}]
},
{
"name": "Linting",
"recommendations": [{
"name": "clippy",
"link": "https://github.com/rust-lang/rust-clippy#usage",
"docs": "https://doc.rust-lang.org/clippy/",
"notes": "The official Rust linter."
}, {
"name": "cargo-semver-checks",
"link": "https://github.com/obi1kenobi/cargo-semver-checks",
"notes": "Lint your crate releases for semantic versioning violations."
}]
},
{
"name": "Code Formatting",
"recommendations": [{
"name": "rustfmt",
"link": "https://github.com/rust-lang/rustfmt#rustfmt----",
"docs": "https://rust-lang.github.io/rustfmt/",
"notes": "The official Rust code formatter."
}]
},
{
"name": "Cross Compilation",
"recommendations": [{
"name": "cross",
"link": "https://github.com/cross-rs/cross#cross",
"docs": "https://github.com/cross-rs/cross/wiki/Getting-Started",
"notes": "Seamless cross-compiling using Docker containers."
}, {
"name": "cargo-zigbuild",
"link": "https://github.com/rust-cross/cargo-zigbuild",
"notes": "Easily cross-compile using Zig as the linker."
}]
},
{
"name": "Managing Dependencies",
"recommendations": [{
"name": "cargo-edit",
"link": "https://github.com/killercup/cargo-edit",
"notes": "Adds 'cargo upgrade' and 'cargo set-version' commands to cargo"
}, {
"name": "cargo-outdated",
"link": "https://github.com/kbknapp/cargo-outdated#cargo-outdated",
"notes": "Finds dependencies that have available updates"
}, {
"name": "cargo-audit",
"link": "https://github.com/RustSec/rustsec/tree/main/cargo-audit#rustsec-cargo-audit",
"notes": "Check dependencies for reported security vulnerabilities"
}, {
"name": "cargo-license",
"link": "https://github.com/onur/cargo-license#cargo-license",
"notes": "Lists licenses of all dependencies"
}, {
"name": "cargo-deny",
"link": "https://github.com/EmbarkStudios/cargo-deny#-cargo-deny",
"docs": "https://embarkstudios.github.io/cargo-deny/",
"notes": "Enforce policies on your code and dependencies."
}]
},
{
"name": "Testing",
"recommendations": [{
"name": "cargo-nextest",
"link": "https://nexte.st",
"notes": "Faster, better test runner"
},
{
"name": "insta",
"link": "https://insta.rs",
"docs": "https://insta.rs/docs/",
"notes": "Snapshot testing with inline snapshot support"
}]
},
{
"name": "Benchmarking",
"recommendations": [{
"name": "criterion",
"notes": "Statistically accurate benchmarking tool for benchmarking libraries"
}, {
"name": "divan",
"notes": "Simple yet powerful benchmarking library with allocation profiling"
}, {
"name": "hyperfine",
"link": "https://github.com/sharkdp/hyperfine#hyperfine",
"notes": "Tool for benchmarking compiled binaries (similar to unix time command but better)"
}]
},
{
"name": "Performance",
"recommendations": [{
"name": "cargo-flamegraph",
"link": "https://github.com/flamegraph-rs/flamegraph#cargo-flamegraph",
"notes": "Execution flamegraph generation"
}, {
"name": "dhat",
"notes": "Heap memory profiling"
}, {
"name": "cargo-show-asm",
"notes": "Print the generated assembly for a Rust function"
}]
},
{
"name": "Debugging Macros",
"notes": "<a href=\"https://github.com/rust-lang/rust-analyzer\">Rust Analyzer</a> also allows you to <a href=\"https://rust-analyzer.github.io/manual.html#expand-macro-recursively\">expand macros directly in your editor</a>",
"recommendations": [{
"name": "cargo-expand",
"link": "https://github.com/dtolnay/cargo-expand#cargo-expand",
"notes": "Allows you to inspect the code that macros expand to"
}]
},
{
"name": "Release Automation",
"recommendations": [{
"name": "cargo-release",
"link": "https://github.com/crate-ci/cargo-release#cargo-release",
"docs": "https://github.com/crate-ci/cargo-release/tree/master/docs",
"notes": "Helper for publishing new crate versions."
}, {
"name": "Release-plz",
"link": "https://release-plz.ieni.dev/",
"docs": "https://release-plz.ieni.dev/docs",
"notes": "Release Rust crates from CI with a Release PR."
}]
},
{
"name": "Continuous Integration",
"recommendations": [{
"name": "rust-toolchain (github action)",
"link": "https://github.com/dtolnay/rust-toolchain#install-rust-toolchain",
"notes": "Github action to install Rust components via rustup"
}, {
"name": "rust-cache (github action)",
"link": "https://github.com/Swatinem/rust-cache#rust-cache-action",
"notes": "Github action to cache compilation artifacts and speed up subsequent runs."
}, {
"name": "install-action (github action)",
"link": "https://github.com/taiki-e/install-action",
"notes": "GitHub Action for installing development tools (mainly from GitHub Releases)."
}]
}
]
}
]
},
{
"slug": "math-scientific",
"name": "Math / Scientific",
"description": "The <a href=\"https://lib.rs/crates/num\">num</a> crate is trusted and has a variety of numerical functionality that is missing from the standard library.",
"subgroups": [],
"purposes": [
{
"name": "Abstracting over different number types",
"recommendations": [{
"name": "num-traits",
"notes": "Traits like Number, Add, etc that allow you write functions that are generic over the specific numeric type"
}]
},
{
"name": "Big Integers",
"recommendations": [
{ "name": "num-bigint", "notes": "It's not the fastest, but it's part of the trusted num library." },
{ "name": "rug", "notes": "LGPL licensed. Wrapper for GMP. Much faster than num-bigint." }
]
},
{
"name": "Big Decimals",
"recommendations": [
{ "name": "rust_decimal", "notes": "The binary representation consists of a 96 bit integer number, a scaling factor used to specify the decimal fraction and a 1 bit sign." }
]
},
{
"name": "Sortable Floats",
"recommendations": [
{ "name": "ordered-float", "notes": "Float types that don't allow NaN and are therefore orderable. You can also use the <code>total_cmp</code> method from the standard library like <code>.sort_by(|a, b| a.total_cmp(&b))</code>." }
]
},
{
"name": "Linear Algebra",
"recommendations": [
{ "name": "nalgebra", "notes": "General-purpose linear algebra library with transformations and statically-sized or dynamically-sized matrices. However it supports only vectors (1d) and matrices (2d) and not higher-dimensional tensors." },
{ "name": "ndarray", "notes": "Less featureful than nalgebra but supports arbitrarily dimensioned arrays" }
]
},
{
"name": "DataFrames",
"recommendations": [
{ "name": "polars", "notes": "Similar to the Pandas library in Python but in pure Rust. Uses the Apache Arrow Columnar Format as the memory model." },
{ "name": "datafusion", "notes": "<a href=\"https://arrow.apache.org/datafusion\">Apache DataFusion</a> is an in-memory query engine that uses Apache Arrow as the memory model" }
]
}
]
},
{
"slug": "ffi",
"name": "FFI / Interop",
"description": "Crates that allow Rust to interact with code written in other languages.",
"subgroups": [],
"purposes": [
{
"name": "C",
"recommendations": [
{ "name": "bindgen", "notes": "Generate Rust bindings to C libraries" },
{ "name": "cbindgen", "notes": "Generate C bindings to Rust libraries" },
{ "name": "cc", "notes": "Compile and link C code as part of your Cargo build" }
]
},
{
"name": "C++",
"recommendations": [
{ "name": "cxx", "notes": "Safe C++ <-> Rust interop by generating code for both sides." }
]
},
{
"name": "Python",
"recommendations": [
{ "name": "pyo3", "notes": "Supports both calling python code from Rust and exposing Rust code to Python" }
]
},
{
"name": "Node.js",
"recommendations": [
{ "name": "napi", "notes": "is a framework for building pre-compiled Node.js addons in Rust." },
{ "name": "neon", "notes": "Slower than napi, but also widely used and well-maintained" }
]
},
{
"name": "Ruby",
"recommendations": [
{ "name": "magnus", "notes": "Ruby bindings for Rust. Write Ruby extension gems in Rust, or call Ruby from Rust. Supported by Ruby's rubygems and bundler" },
{ "name": "rutie", "notes": "Supports both embedding Rust into Ruby applications and embedding Ruby into Rust applications" }
]
},
{
"name": "Objective-C",
"recommendations": [
{ "name": "objc2", "notes": "Sound and Idiomatic Rust to Objective-C interface and runtime bindings. Main crate in the objc2 project." }
],
"see_also": [
{ "name": "objc", "notes": "Older non-idiomatic bindings crate. Has been superseded by objc2." }
]
},
{
"name": "Java/JVM",
"recommendations": [
{ "name": "jni", "notes": "Implement Java methods for JVM and Android in Rust. Call Java code from Rust. Embed JVM in Rust applications." }
]
},
{
"name": "Lua",
"recommendations": [
{ "name": "mlua", "notes": "Bindings to Lua 5.4, 5.3, 5.2, 5.1 (including LuaJIT)" }
]
},
{
"name": "Dart/Flutter",
"recommendations": [
{ "name": "flutter_rust_bridge", "notes": "Works with Dart with or without Flutter" }
]
},
{
"name": "Erlang/Elixir",
"recommendations": [
{ "name": "rustler", "notes": "Safe Rust bridge for creating Erlang NIF functions" }
]
},
{
"name": "Kotlin/Swift/Python/Ruby",
"recommendations": [
{ "name": "uniffi", "notes": "Share Rust codebase to create cross-platform apps (also 3rd party support for Kotlin Multiplatform, Go, C#, Dart)" }
]
}
]
},
{
"slug": "cryptography",
"name": "Cryptography",
"description": "Crates that provide implementations of cryptographic algorithms. This section attempts to list the best crates for the listed algorithms, but does not intend to make recommendations for the algorithms themselves.<br />",
"subgroups": [],
"purposes": [
{
"name": "Password Hashing",
"notes": "For more algorithms, see <a href=\"https://github.com/RustCrypto/password-hashes#rustcrypto-password-hashes\">Rust Crypto Password Hashes</a>.",
"recommendations": [
{ "name": "argon2" },
{ "name": "scrypt" },
{ "name": "bcrypt" }
]
},
{
"name": "General Purpose Hashing",
"notes": "For more algorithms, see <a href=\"https://github.com/RustCrypto/hashes#rustcrypto-hashes\">Rust Crypto Hashes</a>.",
"recommendations": [
{ "name": "blake3" },
{ "name": "sha2" }
]
},
{
"name": "AEAD Encryption",
"notes": "For more algorithms, see <a href=\"https://github.com/RustCrypto/AEADs#rustcrypto-authenticated-encryption-with-associated-data-aead-algorithms\">Rust Crypto AEADs</a>.",
"recommendations": [
{ "name": "aes-gcm-siv" },
{ "name": "aes-gcm" },
{ "name": "chacha20poly1305" }
]
},
{
"name": "RSA",
"recommendations": [
{ "name": "rsa" }
]
},
{
"name": "Digital Signatures",
"notes": "For more algorithms, see <a href=\"https://github.com/RustCrypto/signatures#rustcrypto-signatures--\">Rust Crypto Signatures</a>.",
"recommendations": [
{ "name": "ed25519", "notes": "Use in conjunction with the ed25519-dalek crate." },
{ "name": "ecdsa" },
{ "name": "dsa" }
]
},
{
"name": "Certificate Formats",
"notes": "For more formats, see <a href=\"https://github.com/RustCrypto/formats#rustcrypto-formats--\">Rust Crypto Formats</a>.",
"recommendations": [
{ "name": "der" },
{ "name": "pem-rfc7468" },
{ "name": "pkcs8" },
{ "name": "x509-cert" }
]
},
{
"name": "TLS / SSL",
"recommendations": [{
"name": "rustls",
"notes": "A portable pure-rust high-level implementation of TLS. Implements TLS 1.2 and higher."
}, {
"name": "native-tls",
"notes": "Delegates to the system TLS implementations on windows and macOS, and uses OpenSSL on linux."
}],
"see_also": [{
"name": "webpki",
"notes": "X.509 Certificate validation. Builds on top of ring."
}, {
"name": "ring",
"notes": "Fork of BoringSSL. Provides low-level cryptographic primitives for TLS/SSL"
}]
},
{
"name": "Utilities",
"recommendations": [{
"name": "subtle",
"notes": "Utilities for writing constant-time algorithms"
},
{
"name": "zeroize",
"notes": "Securely erase memory"
}]
}
]
},
{
"slug": "networking",
"name": "Networking",
"description": "TCP, HTTP, GRPc, etc. And the executors required to do asynchronous networking.",
"subgroups": [
{
"slug": "async-foundations",
"name": "Async Foundations",
"description": "To do async programming using the async-await in Rust you need a runtime to execute drive your Futures.",
"purposes": [
{
"name": "General Purpose Async Executors",
"recommendations": [{
"name": "tokio",
"notes": "The oldest async runtime in the Rust ecosystem and still the most widely supported. Recommended for new projects."
}, {
"name": "futures-executor",
"notes": "A minimal executor. In particular, the <a href=\"https://docs.rs/futures-executor/latest/futures_executor/fn.block_on.html\">block_on</a> function is useful if you want to run an async function synchronously in codebase that is mostly synchronous."
}, {
"name": "smol",
"notes": "A small and modular async runtime. Since the implementation is modularized in smaller crates, you can directly use only the required crates instead of depending on the entire runtime."
}]
},
{
"name": "Async Utilities",
"recommendations": [{
"name": "futures",
"notes": "Utility functions for working with Futures and Streams"
}, {
"name": "async-trait",
"notes": "Provides a workaround for the lack of language support for async functions in traits"
}]
},
{
"name": "io_uring",
"recommendations": [{
"name": "glommio",
"notes": "Use if you need io_uring support. Still somewhat experimental but rapidly maturing."
}]
}
]
},
{
"slug": "http-foundations",
"name": "HTTP",
"description": "HTTP client and server libraries, as well as lower-level building blocks.",
"purposes": [
{
"name": "Types & Interfaces",
"recommendations": [{
"name": "http",
"notes": "The `http` crate doesn't actually contain an HTTP implementation. Just types and interfaces to help interoperability."
}]
},
{
"name": "Low-level HTTP Implementation",
"recommendations": [{
"name": "hyper",
"notes": "A low-level HTTP implementation (both client and server). Implements HTTP/1, and HTTP/2. Works best with the tokio async runtime, but can support other runtimes."
}]
},
{
"name": "HTTP Client",
"recommendations": [{
"name": "reqwest",
"notes": "Full-fat HTTP client. Can be used in both synchronous and asynchronous code. Requires tokio runtime."
}, {
"name": "ureq",
"notes": "Minimal synchronous HTTP client focussed on simplicity and minimising dependencies."
}]
},
{
"name": "HTTP Server",
"recommendations": [{
"name": "axum",
"notes": "A minimal and ergonomic framework. An official part of the tokio project. Recommend for most new projects."
}, {
"name": "actix-web",
"notes": "A performance focussed framework. All Rust frameworks are fast, but choose actix-web if you need the absolutely maximum performance."
}],
"see_also": [{
"name": "rocket",
"notes": "Has an excellent API and a solid implementation. However development has been intermittent."
}, {
"name": "poem",
"notes": "Automatically generates OpenAPI definitions."
}, {
"name": "warp",
"notes": "Very similar to axum but with a quirkier API. This is a solid framework, but you should probably prefer Axum unless you particularly like the API"
}, {
"name": "tide",
"notes": "Similar to Axum, but based on async-std rather than tokio"
}]
},
{
"name": "GraphQL Server",
"recommendations": [{
"name": "async-graphql",
"notes": "A high-performance graphql server library that's fully specification compliant. Integrates with actix-web, axum, poem, rocket, tide, warp."
}]
}
]
},
{
"slug": "websockets",
"name": "Websockets",
"description": "This section includes libraries for you to use just websockets. However note that many of the HTTP server frameworks in the section above also support websockets",
"purposes": [
{
"name": "Low-level",
"recommendations": [{
"name": "tungstenite",
"notes": "Low-level crate that others build on"
}]
},
{
"name": "General Purpose",
"recommendations": [{
"name": "tokio-tungstenite",
"notes": "If you are using the tokio executor"
}, {
"name": "async-tungstenite",
"notes": "If you are using the async-std executor"
}]
}
]
},
{
"slug": "grpc",
"name": "gRPC",
"purposes": [
{
"name": "General Purpose",
"recommendations": [{
"name": "tonic",
"notes": "gRPC over HTTP/2 with full support for asynchronous code. Works with tokio"
}]
}
]
},
{
"slug": "dbus",
"name": "D-Bus",
"description": "For cross-platform D-Bus clients and services.",
"purposes": [
{
"name": "General Purpose",
"recommendations": [{
"name": "zbus",
"notes": "A Rust-only (a)sync implementation of the protocol. Provides high-level proxies and zbus_xmlgen for scaffolding. Includes a book for D-Bus/zbus beginners."
}]
},
{
"name": "Bindings",
"recommendations": [{
"name": "dbus",
"notes": "Bindings for the battle-tested libdbus implementation. Has sister crates for asynchrony, codegen, etc."
}]
}
]
}
]
},
{
"slug": "databases",
"name": "Databases",
"subgroups": [
{
"slug": "sql-databases",
"name": "SQL Databases",
"description": "The multi-database options (SQLx and Diesel) are generally quite good, and worth considering even if you only need support for a single database.",
"purposes": [
{
"name": "Multi Database",
"recommendations": [{
"name": "sqlx",
"notes": "Works with Postgres, MySQL, SQLite, and MS SQL.<br />Supports compile time checking of queries. Async: supports both tokio and async-std."
}]
},
{
"name": "ORMs",
"recommendations": [
{
"name": "diesel",
"notes": "Has excellent performance and takes an approach of strict compile time guarantees. The main crate is Sync only, but <a href=\"https://lib.rs/crates/diesel-async\">diesel-async</a> provides an async connection implementation."
}, {
"name": "sea-orm",
"notes": "Built on top of sqlx (see above). There is also a related sea-query crate that provides a query builder without full ORM functionality."
}]
},
{
"name": "Postgres",
"recommendations": [{
"name": "tokio-postgres",
"notes": "Postgres-specific library. Performs better than SQLx"
}]
},
{
"name": "MySQL",
"recommendations": [{
"name": "mysql_async",
"notes": "Has a poorly designed API. Prefer SQLx or Diesel for MySQL"
}]
},
{
"name": "SQLite",
"recommendations": [{
"name": "rusqlite",
"notes": "Provides a sync API to SQLite + provides access to advanced sqlite features."
}]
},
{
"name": "MS SQL",
"recommendations": [{
"name": "tiberius",
"notes": "MS SQL specific library. Has better support for advanced column types than SQLx."
}]
},
{
"name": "Oracle",
"recommendations": [{
"name": "diesel-oci",
"notes": "Diesel backend and connection implementation for oracle databases"
}, {
"name": "oracle",
"notes": "Rust bindings to ODPI-C"
}, {
"name": "sibyl",
"notes": "An OCI-based interface supporting both blocking (threads) and nonblocking (async) AP"
}]
}
]
},
{
"slug": "other-databases",
"name": "Other Databases",
"purposes": [
{
"name": "Redis",
"recommendations": [{
"name": "redis"
}]
},
{
"name": "MongoDB",
"recommendations": [{
"name": "mongodb"
}]
},
{
"name": "ElasticSearch",
"recommendations": [{
"name": "elasticsearch"
}]
},
{
"name": "LMDB",
"notes": "<a href=\"https://github.com/mozilla/rkv\">The rkv crate</a> depends on <a href=\"https://github.com/mozilla/lmdb-rs\">the lmdb-rkv dependency</a> which is archived and is inactive.",
"recommendations": [{
"name": "heed",
"notes": "A fully typed LMDB wrapper with minimum overhead."
}]
},
{
"name": "Rocks DB",
"recommendations": [{
"name": "rocksdb"
}]
},
{
"name": "Cassandra",
"recommendations": [{
"name": "cassandra-protocol",
"notes": "Low-level Cassandra protocol implementation."
}, {
"name": "cdrs-tokio",
"notes": "High-level async Cassandra driver."
}]
}
]
},
{
"slug": "sql-utilities",
"name": "Utilities",
"purposes": [
{
"name": "Connection pool",
"recommendations": [{
"name": "deadpool",
"notes": "A dead simple async pool for connections and objects of any type."
}]
}
]
}
]
},
{
"slug": "cli-tools",
"name": "CLIs",
"subgroups": [
{
"slug": "argument-parsing",
"name": "Argument Parsing",
"description": "See <a target=\"_blank\" href=\"https://github.com/rust-cli/argparse-benchmarks-rs\">argparse-benchmarks-rs</a> for a full comparison of the crates mentioned here and more.",
"purposes": [
{
"name": "Fully-featured",
"recommendations": [{
"name": "clap",
"notes": "Ergonomic, battle-tested, includes the kitchen sink, and is fast at runtime. However compile times can be slow"
}],
"see_also": [{
"name": "bpaf",
"notes": "Faster compile times than clap while still being featureful. But still has some rough edges, and the API can be confusing at times."
}]
},
{
"name": "Minimal",
"recommendations": [{
"name": "lexopt",
"notes": "Fast compile times, fast runtime, pedantic about correctness. API is less ergonomic"
}, {
"name": "pico-args",
"notes": "Fast compile times, fast runtime, more lax about correctness. API is more ergonomic"
}]
}
]
},
{
"slug": "utility",
"name": "Utility",
"description": "Helpers that are often useful when implementing CLIs",
"purposes": [
{
"name": "Globbing",
"recommendations": [{
"name": "globset",
"link": "https://crates.io/crates/globset",
"docs": "https://docs.rs/globset",
"notes": "High-performance globbing that allows multiple globs to be evaluated at once"
}]
},
{
"name": "Directory walking",
"recommendations": [{
"name": "walkdir",
"link": "https://crates.io/crates/walkdir",
"docs": "https://docs.rs/walkdir",
"notes": "Basic recursive filesystem walking."
}, {
"name": "ignore",
"link": "https://crates.io/crates/ignore",
"docs": "https://docs.rs/ignore",
"notes": "Recursive filesystem walking that respects ignore files (like .gitignore)"
}]
},
{
"name": "File watching",
"recommendations": [{
"name": "notify",
"notes": "Watch files or directories and execute a function when they change"
}]
},
{
"name": "User directories",
"recommendations": [{
"name": "dirs",
"notes": "Provide platform-specific locations for configuration, cache, and other data"
}, {
"name": "directories",
"notes": "A higher-level library that can also compute paths for applications"
}],
"see_also": [{
"name": "etcetera",
"notes": "An alternative with a different license"
}]
}
]
},
{
"slug": "rendering",
"name": "Terminal Rendering",
"description": "For fancy terminal rendering and TUIs. The crates recommended here work cross-platform (including windows).",
"purposes": [
{
"name": "Coloured Output",
"recommendations": [{
"name": "termcolor",
"link": "https://crates.io/crates/termcolor",
"docs": "https://docs.rs/termcolor",
"notes": "Cross-platform terminal colour output"
}]
},
{
"name": "Progress indicators",
"recommendations": [{
"name": "indicatif",
"notes": "Progress bars and spinners"
}]
},
{
"name": "TUI",
"recommendations": [{
"name": "ratatui",
"notes": "A high-level TUI library with widgets, layout, etc. "
}, {
"name": "crossterm",
"notes": "Low-level cross-platform terminal rendering and event handling"
}]
},
{
"name": "Interactive prompts",
"recommendations": [{
"name": "inquire",
"notes": "Ask for confirmation, selection, text input and more"
}]
}
]
}
]
},
{
"slug": "concurrency",
"name": "Concurrency",
"subgroups": [
{
"slug": "data-structures",
"name": "Data Structures",
"purposes": [
{
"name": "Mutex",
"recommendations": [{
"name": "parking_lot",
"notes": "std::sync::Mutex also works fine. But Parking Lot is faster."
}]
},
{
"name": "Atomic pointer swapping",
"recommendations": [{
"name": "arc-swap",
"notes": "Useful for sharing data that has many readers but few writers"
}]
},
{
"name": "Concurrent HashMap",
"notes": "See <a target=\"_blank\" href=\"https://github.com/xacrimon/conc-map-bench\">conc-map-bench</a> for comparative benchmarks of concurrent HashMaps.",
"recommendations": [{
"name": "dashmap",
"notes": "The fastest for general purpose workloads"
}, {
"name": "papaya",
"notes": "Particularly good for read-heavy workloads."
}]
},
{
"name": "Channels",
"notes": "See <a href=\"https://docs.rs/tokio/latest/tokio/sync/mpsc/index.html#communicating-between-sync-and-async-code\">communicating-between-sync-and-async-code</a> for notes on when to use async-specific channels vs general purpose channels.",
"recommendations": [
{
"name": "crossbeam-channel",
"notes": "The same channel algorithm as in the standard library but with a more powerful API, offering a Go-like 'select' feature."
}, {
"name": "flume",
"notes": "Smaller and simpler than crossbeam-channel and almost as fast"
}, {
"name": "tokio",
"notes": "Tokio's sync module provides channels for using in async code"
}, {
"name": "postage",
"notes": "Channels that integrate nicely with async code, with different options than Tokio"
}]
},
{
"name": "Parallel computation",
"recommendations": [
{
"name": "rayon",
"notes": "Convert sequential computation into parallel computation with one call - `par_iter` instead of `iter`"
}]
}
]
}
]
},
{
"slug": "graphics",
"name": "Graphics",
"subgroups": [
{
"slug": "gui",
"name": "GUI",
"purposes": [
{
"name": "GTK",
"recommendations": [{
"name": "gtk4",
"notes": "Rust bindings to GTK4. These are quite well supported, although you'll often need to use the C documentation."
}, {
"name": "relm4",
"notes": "A higher-level library that sits on top of gtk4-rs"
}]
},
{
"name": "Web-based GUI",
"recommendations": [{
"name": "tauri",
"notes": "Electron-like web-based UI. Except it uses system webviews rather than shipping chromium, and non-UI code is written in Rust rather than node.js"
}, {
"name": "dioxus",
"notes": "A very nice API layer that has Tauri, Web, and TUI renderers. A native renderer is coming soon."
}]
},
{
"name": "Native GUI",
"recommendations": [{
"name": "egui",
"notes": "Immediate-mode UI with lots of widgets. Very useable out of the box if your needs are simple and you don't need to customise the look and feel"
}, {
"name": "iced",
"notes": "Retained mode UI with a nice API. It's useable for basic apps, but has a number of missing features including multiple windows, layers, and proper text rendering."
}, {
"name": "slint",
"notes": "A stable and feature-rich UI toolkit with a declarative language. Licensed under GPL, royalty-free for desktop/mobile, or with paid options for proprietary embedded use."
}],
"see_also": [{
"name": "floem",
"notes": "Inspired by Xilem, Leptos and rui, floem is currently more complete than any of them for native UI. Used by the Lapce text editor."
}, {
"name": "vizia",
"link": "https://github.com/vizia/vizia",
"docs": "https://book.vizia.dev/",
"notes": "Fairly complete with sophisticated layout and text layout, but has yet to make a stable release."
}, {
"name": "xilem",
"link": "https://github.com/linebender/xilem",
"docs": "https://docs.rs/xilem",
"notes": "The replacement for Druid based on the more interoperable Vello and Glazier crates. However, it's currently not complete enough to be usable."
}, {
"name": "freya",
"link": "https://github.com/marc2332/freya",
"docs": "https://book.freyaui.dev/",
"notes": "Dioxus-based GUI framework using Skia for rendering."
}, {
"name": "gpui",
"link": "https://github.com/zed-industries/zed/tree/main/crates/gpui",
"docs": "https://www.gpui.rs/#docs",
"notes": "High performance framework used in the Zed text editor. Now available on macOS and linux."
}, {
"name": "makepad",
"link": "https://github.com/makepad/makepad",
"notes": "Makepad has a strong focus on performance and minimising bloat but is consequently less feature complete in areas such as accessibility and system integration."
}, {
"name": "ribir",
"link": "https://ribir.org/",
"docs": "https://ribir.org/docs/introduction/"
},
{ "name": "kas" }]
}, {
"name": "Window creation",
"recommendations": [{
"name": "winit",
"notes": "The defacto standard option. Uses an event loop based architecture. Widely used and should probably be the default choice."
}, {
"name": "tao",
"notes": "A fork of winit by the Tauri project which adds support for things like system menus that desktop apps need."
}, {
"name": "baseview",
"link": "https://github.com/RustAudio/baseview",
"notes": "Specialized window creation library targeting windows to be embedded in other applications (e.g. DAW plugins)"
}]
}, {
"name": "2D Renderers",
"recommendations": [{
"name": "femtovg",
"notes": "OpenGL based. Offers a simple API. Probably the easiest to get started with."
}, {
"name": "skia-safe",
"notes": "Bindings to the Skia C++ library. The most complete option with excellent performance. However, it can be difficult to get it to compile."
}, {
"name": "vello",
"notes": "WGPU based and uses cutting edge techniques to render vector paths using the GPU. Still somewhat immature and hasn't yet put out a stable release."
}, {
"name": "vger",
"notes": "A simpler WGPU based option which is less innovative but currently more stable than vello."
}, {
"name": "webrender",
"notes": "OpenGL based. Mature with production usage in Firefox but documentation and OSS maintenance are lacking."
}]
}, {
"name": "UI layout",
"recommendations": [{
"name": "taffy",
"notes": "Supports Flexbox and CSS Grid algorithms."
}, {
"name": "morphorm",
"notes": "Implements it's own layout algorithm based on Subform layout"
}]
}, {
"name": "Text layout",
"recommendations": [{
"name": "cosmic-text",
"notes": "Full text layout including rich text and support for BiDi and non-latin scripts. The best option for now."
}, {
"name": "parley",
"link": "https://github.com/dfrg/parley",
"docs": "https://docs.rs/parley/latest/parley/",
"notes": "Another very accomplished text layout library used by Druid/Xilem."
}]
}, {
"name": "Accessibility",
"recommendations": [{
"name": "accesskit",
"notes": "Allows you to export a semantic tree representing your UI to make accessible to screen readers and other assistive technologies"
}]
}, {
"name": "Clipboard",
"recommendations": [{
"name": "arboard",
"notes": "A fork of rust-clipboard that supports copy and pasting of both text and images on Linux (X11/Wayland), MacOS and Windows."
}]
}, {
"name": "File Dialogs",
"recommendations": [{
"name": "rfd",
"notes": "Platform-native open/save file dialogs. Can be used in conjunction with other UI libraries."
}]
}
]
},
{
"slug": "game-development",
"name": "Game Development",
"purposes": [
{
"name": "Game Engines",
"notes": "",
"recommendations": [{
"name": "bevy",
"notes": "An ECS based game engine, good for 3D but also capable of 2D."
}, {
"name": "fyrox",
"notes": "An OOP-focused game engine with 3D and 2D support and a full GUI scene editor."
}, {
"name": "ggez",
"notes": "A simpler option for 2d games only."
}, {
"name": "macroquad",
"notes": "A simple and easy to use 2d game library, great for beginners."
}]
},
{
"name": "3D Math",
"recommendations": [{
"name": "glam",
"notes": "Fast math library optimised for game development use cases"
}]
}
]
}
]
}
]
}