Example Code and Templates

You can use the Rust Playground↗ to quickly test snippets of code.

Lists of Popular Rust Repositories

"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 cargo-generate~crates.io cargo-generate~github cargo-generate~lib.rs

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: