What is blessed.rs?
The standard library in Rust is much smaller than in Python or Go, for example. Those languages come with "batteries included" support for things like HTTP(S), JSON, timezones, random numbers, and async IO. Rust, on the other hand, gets things like that from the crates.io ecosystem and the Cargo package manager. But with almost 100 thousand crates to choose from, a common complaint from new Rust developers is that they don't know where to start, which crates they ought to use, and which crates they ought to trust. This list attempts to answer those questions.
See also lib.rs which takes a more automated approach (ordering crates by number of downloads) and also has an excellent search function.
Tooling
Developer tools for working with Rust projects.
Use Case | Recommended Crates |
---|---|
Toolchain Management |
rustup
|
Linting |
clippy
cargo-semver-checks
|
Code Formatting |
rustfmt
|
Cross Compilation |
cross
cargo-zigbuild
|
Managing Dependencies |
cargo-edit
cargo-outdated
cargo-audit
cargo-license
cargo-deny
|
Testing |
cargo-nextest
insta
|
Benchmarking |
criterion
[docs]
divan
[docs]
hyperfine
|
Performance |
cargo-flamegraph
dhat
[docs]
cargo-show-asm
[docs]
|
Debugging Macros |
Rust Analyzer also allows you to expand macros directly in your editor
cargo-expand
|
Release Automation |
cargo-release
Release-plz
|
Continuous Integration |
rust-toolchain (github action)
rust-cache (github action)
install-action (github action
|
Common
Very commonly used crates that everyone should know about
General
General purpose
Use Case | Recommended Crates |
---|---|
Random numbers |
rand
[docs]
|
Time & Date |
Unfortunately there is no clear answer as to which is best between time and chrono.
time
[docs]
chrono
[docs]
|
Serialization (JSON, YAML, etc) |
See here for supported formats.
serde
[docs]
|
Regular Expressions |
regex
[docs]
fancy-regex
[docs]
|
UUIDs |
uuid
[docs]
|
Temporary files |
tempfile
[docs]
|
Gzip (de)compression |
flate2
[docs]
|
Insertion-ordered map |
indexmap
[docs]
|
Stack-allocated arrays |
arrayvec
[docs]
smallvec
[docs]
tinyvec
[docs]
|
HTTP Requests |
See the HTTP section below for server-side libraries
reqwest
[docs]
ureq
[docs]
|
Error Handling
Crates for more easily handling errors
Use Case | Recommended Crates |
---|---|
For applications |
anyhow
[docs]
color-eyre
[docs]
|
For libraries |
See also: Designing error types in Rust
thiserror
[docs]
|
Logging
Crates for logging. Note that in general you will need a seperate crate for actually printing/storing the logs
Use Case | Recommended Crates |
---|---|
Text-based logging |
tracing
[docs]
log
[docs]
|
Structured logging |
Language Extensions
General purpose utility crates that extend language and/or stdlib functionality.
Use Case | Recommended Crates |
---|---|
Lazy static variable initialization |
The core functionality of once_cell is now included in the standard library with the remaining parts on track to be stabilised in future.
once_cell
[docs]
lazy_static
[docs]
|
Iterator helpers |
itertools
[docs]
|
Macro helpers |
syn
[docs]
quote
[docs]
paste
[docs]
darling
[docs]
|
Safe type casts | |
Bitflags |
System
For low-level interaction with the underling platform / operating system
Use Case | Recommended Crates |
---|---|
Memory mapping files | |
Libc | |
Windows (OS) |
windows
[docs]
winapi
[docs]
|
*nix (OSs) |
rustix
[docs]
nix
[docs]
|
Math / Scientific
The num crate is trusted and has a variety of numerical functionality that is missing from the standard library.
Use Case | Recommended Crates |
---|---|
Abstracting over different number types |
num-traits
[docs]
|
Big Integers |
num-bigint
[docs]
rug
[docs]
|
Big Decimals |
rust_decimal
[docs]
|
Sortable Floats |
ordered-float
[docs]
|
Linear Algebra |
nalgebra
[docs]
ndarray
[docs]
|
DataFrames |
polars
[docs]
datafusion
[docs]
|
FFI / Interop
Crates that allow Rust to interact with code written in other languages.
Use Case | Recommended Crates |
---|---|
C | |
C++ |
cxx
[docs]
|
Python |
pyo3
[docs]
|
Node.js |
napi
[docs]
neon
[docs]
|
Ruby |
rutie
[docs]
|
Objective-C | |
Java/JVM |
jni
[docs]
|
Lua |
mlua
[docs]
|
Dart/Flutter |
flutter_rust_bridge
[docs]
|
Erlang/Elixir |
rustler
[docs]
|
Kotlin/Swift/Python/Ruby |
uniffi
[docs]
|
Cryptography
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.
Use Case | Recommended Crates |
---|---|
Password Hashing |
For more algorithms, see Rust Crypto Password Hashes. |
General Purpose Hashing |
For more algorithms, see Rust Crypto Hashes. |
AEAD Encryption |
For more algorithms, see Rust Crypto AEADs. |
RSA | |
Digital Signatures |
For more algorithms, see Rust Crypto Signatures.
ed25519
[docs]
|
Certificate Formats |
For more formats, see Rust Crypto Formats. |
TLS / SSL |
rustls
[docs]
native-tls
[docs]
|
Utilities |
subtle
[docs]
|
Networking
TCP, HTTP, GRPc, etc. And the executors required to do asynchronous networking.
Async Foundations
To do async programming using the async-await in Rust you need a runtime to execute drive your Futures.
Use Case | Recommended Crates |
---|---|
General Purpose Async Executors |
tokio
[docs]
futures-executor
[docs]
|
Async Utilities |
futures
[docs]
async-trait
[docs]
|
io_uring |
glommio
[docs]
|
HTTP
HTTP client and server libraries, as well as lower-level building blocks.
Use Case | Recommended Crates |
---|---|
Types & Interfaces |
http
[docs]
|
Low-level HTTP Implementation |
hyper
[docs]
|
HTTP Client |
reqwest
[docs]
ureq
[docs]
|
HTTP Server |
axum
[docs]
actix-web
[docs]
See also (click to open)
rocket
[docs]
poem
[docs]
warp
[docs]
tide
[docs]
|
GraphQL Server |
async-graphql
[docs]
|
Websockets
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
Use Case | Recommended Crates |
---|---|
Low-level |
tungstenite
[docs]
|
General Purpose |
tokio-tungstenite
[docs]
async-tungstenite
[docs]
|
gRPC
Use Case | Recommended Crates |
---|---|
General Purpose |
tonic
[docs]
|
Databases
SQL Databases
The multi-database options (SQLx and Diesel) are generally quite good, and worth considering even if you only need support for a single database.
Use Case | Recommended Crates |
---|---|
Multi Database |
sqlx
[docs]
|
ORMs |
diesel
[docs]
sea-orm
[docs]
|
Postgres |
tokio-postgres
[docs]
|
MySQL |
mysql_async
[docs]
|
SQLite |
rusqlite
[docs]
|
MS SQL |
tiberius
[docs]
|
Oracle |
diesel-oci
[docs]
oracle
[docs]
sibyl
[docs]
|
Other Databases
Use Case | Recommended Crates |
---|---|
Redis | |
MongoDB | |
ElasticSearch | |
LMDB |
The rkv crate depends on the lmdb-rkv dependency which is archived and is inactive.
heed
[docs]
|
Rocks DB | |
Cassandra |
cassandra-protocol
[docs]
cdrs-tokio
[docs]
|
Utilities
Use Case | Recommended Crates |
---|---|
Connection pool |
deadpool
[docs]
|
CLIs
Argument Parsing
See argparse-benchmarks-rs for a full comparison of the crates mentioned here and more.
Use Case | Recommended Crates |
---|---|
Fully-featured |
clap
[docs]
|
Minimal |
lexopt
[docs]
pico-args
[docs]
|
Utility
Helpers that are often useful when implementing CLIs
Use Case | Recommended Crates |
---|---|
Globbing |
globset
|
Directory walking |
walkdir
ignore
|
File watching |
notify
[docs]
|
User directories |
dirs
[docs]
directories
[docs]
|
Terminal Rendering
For fancy terminal rendering and TUIs. The crates recommended here work cross-platform (including windows).
Use Case | Recommended Crates |
---|---|
Coloured Output | |
Progress indicators | |
TUI |
ratatui
[docs]
crossterm
[docs]
|
Interactive prompts |
inquire
[docs]
|
Concurrency
Data Structures
Use Case | Recommended Crates |
---|---|
Mutex |
parking_lot
[docs]
|
Atomic pointer swapping |
arc-swap
[docs]
|
Concurrent HashMap |
See conc-map-bench for comparative benchmarks of concurrent HashMaps. |
Channels |
See communicating-between-sync-and-async-code for notes on when to use async-specific channels vs general purpose channels.
crossbeam-channel
[docs]
flume
[docs]
tokio
[docs]
postage
[docs]
|
Parallel computation |
rayon
[docs]
|
Graphics
GUI
Use Case | Recommended Crates |
---|---|
GTK |
gtk4
[docs]
relm4
[docs]
|
Web-based GUI |
tauri
[docs]
dioxus
[docs]
|
Immediate Mode Native GUI |
egui
[docs]
|
Retained Mode Native GUI |
iced
[docs]
floem
vizia
See also (click to open)
xilem
freya
slint
[docs]
druid
[docs]
gpui
makepad
|
Window creation |
winit
[docs]
tao
[docs]
glazier
baseview
|
2D Renderers |
femtovg
[docs]
skia-safe
[docs]
vello
vger
[docs]
webrender
[docs]
|
UI layout |
taffy
[docs]
morphorm
[docs]
|
Text layout |
cosmic-text
[docs]
parley
|
Accessibility |
accesskit
[docs]
|
Clipboard |
arboard
[docs]
|
File Dialogs |
rfd
[docs]
|
Game Development
Use Case | Recommended Crates |
---|---|
Game Engines |
bevy
[docs]
fyrox
[docs]
ggez
[docs]
macroquad
[docs]
|
3D Math |
glam
[docs]
|