Skip to content

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:

Terminal window
cargo install cargo-rusta
cargo rusta new my-api
cd my-api
cargo run

See 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:

Terminal window
cargo build

Next Steps