Rust Cargo logo CC-by Mozilla

My Ten Favorite Rust Crates

Exploring Helpful Rust Libraries

Mike Riley
The Pragmatic Programmers
3 min readMar 2, 2022

--

https://pragprog.com/newsletter/

Before diving into my list, I would like to thank my fellow Pragmatic author Herbert Wolverson for his book, Hands-on Rust, which helped ignite my interest in the language. As a result, I have been swimming in a sea of crates — Rust’s library packages to the uninitiated — and looking for the best ones that fit my personal Rust project needs.

After weeks of searching, learning, implementing, and relying on a number of helpful, community-supplied Rust libraries, I have a list of favorites. Following are my current top ten crates listed in alphabetical order. These crates have boosted my productivity and further deepened my appreciation for the language.

Top Ten Rust Crates

egg-mode

This Twitter API library allows me to easily interact with Twitter via Rust.

hyper

hyper is a simple, tight HTTP Library that is especially helpful for creating bare-bones HTTP web service clients and servers.

okapi

This OpenAPI document generator lets me easily add Swagger docs to my Rust REST projects by harvesting appropriately tagged Rust Doc comments.

os_info

Easily identify specific OS type and version that your Rust app is running on and tailor your app to respond accordingly.

roux

Asynchronously communicate with Reddit via this easy-to-use Reddit API wrapper.

rppal

Anyone running Rust on a Raspberry Pi needs this library to communicate with the Pi’s GPIO, I2C, PWM, SPI, and UART ports and attached peripherals. Especially helpful with home automation projects!

rss

Generate and parse RSS files in Rust with just a few simple lines of code.

rusqlite

Natively create, connect, and modify SQLite database content using standard SQL syntax.

serde_json

One of the most popular, strongly-typed JSON serializer/de-serializer libraries for Rust.

serenity

Connect and interact with Discord services via this well-organized Discord API Rust wrapper.

🏆 So that’s my list — there’s something for every Rust enthusiast to check out. I expect this list to grow exponentially in the coming months and years ahead.

Use Rust to create your next great CLI app consuming and emitting a variety of web-based services. As a bonus, I came across this helpful, unofficially curated list of Rust resources maintained by hundreds of contributors:

📢 What are some of your favorite Rust crates? Leave a comment and share your opinions with other Rust devs!

Be sure to pick up a copy of Portable Python Projects by Mike Riley, available from The Pragmatic Bookshelf. You can save 35 percent with promo code python_automation_2022 now through March 31, 2022. Promo codes are not valid on prior purchases.

--

--