Installation
Installation
Prerequisites
- Rust 1.79 or later (2021 edition)
- Cargo package manager
Scaffold a New Project
The easiest way to get started is with the cargo-rusta CLI, which scaffolds a complete project with all dependencies and configuration:
cargo install cargo-rustacargo rusta new my-apicd my-apicargo runSee the CLI guide for full documentation, including template options.
Add to Existing Project
If you have an existing Rust project, add the crates you need to Cargo.toml:
[dependencies]rusta = "0.1.0"Optional Features
The rusta-apm and rusta-logger crates include optional axum-middleware feature (enabled by default):
[dependencies]rusta-apm = "0.1.0"# Without middleware (if you want custom middleware)rusta-apm = { version = "0.1.0", default-features = false }Verify Installation
Create a minimal main.rs:
use rusta::prelude::*;
fn main() { println!("Rusta installed successfully!");}Build to verify:
cargo buildNext Steps
- Quick Start — Build your first API in 5 minutes
- Project Structure — Recommended folder layout