Example Code and Templates
Example Code and Templates |
"RealWorld" Examples |
Lists of Popular Rust Repositories |
Source Code for Rust Books |
Templates |
You can use the Rust Playground↗ to quickly test snippets of code.
Lists of Popular Rust Repositories
- GitHub Topic: "Rust" topic↗: popular repositories on GitHub.
- Trending GitHub repos↗.
- Awesome Rust↗: a large curated list of Rust resources, including code examples.
- Open-source Projects Categorized as "Rust" (libhunt.com)↗.
rustrepo.com
↗: A curated list of awesome Rust resources.- Top 100 Best GitHub Repositories for Rust↗.
"RealWorld" Examples
The "Real World" Example App↗ (website)↗, dubbed "the mother of all demo apps", is a fullstack medium.com
clone implemented in many languages and frameworks. A list of Rust examples is found here↗.
For example, realworld-rust-axum-sqlx
↗ is a full-stack RealWorld implementation using axum
↗, sqlx
↗, and yew
↗.
Templates
cargo-generate
↗ helps you get up and running quickly with a new Rust project by leveraging a pre-existing git repository as a template.
You will find cargo-generate
-ready templates in this list↗.
Beyond cargo-generate
, search for Rust projects on GitHub↗.
For example, you will find a full template for a REST API written in Rust, engineered for maximum testability: rust-rest
↗.
Source Code for Rust Books
You may also consult the code examples from various Rust books:
- Code↗ for the "Zero To Production In Rust"↗ book.
- Source Code↗ for "Practical Rust Web Projects: Building Cloud and Web-Based Applications", 1st ed.↗ by Shing Lyu.