Welcome to the RustAPI documentation!
| Document | Description |
|---|---|
| Getting Started | Build your first API in 5 minutes |
| Features | Complete feature reference |
| Philosophy | Design principles and decisions |
| Architecture | Internal structure deep dive |
| GraphQL Adapter Plan | Planned GraphQL integration shape and facade design |
| Adaptive Execution Debug Plan | Proposed profiling/debug UX for making execution tiers visible in traces, logs, metrics, and headers |
| Performance Benchmarks | Authoritative source for benchmark methodology and published claims |
| Recommended Production Baseline | Opinionated starting point for production services |
| Production Checklist | Rollout-ready operational checklist |
| Cookbook: Replay Workflow | Official capture → inspect → replay → diff flow for time-travel debugging |
RustAPI is an ergonomic web framework for Rust, inspired by FastAPI's developer experience. It combines Rust's performance and safety with modern DX.
Key Features:
- 🎯 5-line APIs — Minimal boilerplate
- 🛡️ Type Safety — Compile-time guarantees
- 📖 Auto Documentation — Swagger UI out of the box
- 🤖 LLM-Ready — TOON format saves 50-58% tokens
- 🔒 Production Ready — JWT, CORS, rate limiting included
"API surface is ours, engines can change."
RustAPI provides a stable, ergonomic public API. Internal dependencies (hyper, tokio, validator) are implementation details that can be upgraded without breaking your code.
The stable contract lives in rustapi-rs; internal crates are not compatibility targets.
Feature taxonomy:
core-*for framework core behavior.protocol-*for optional protocol integrations.extras-*for optional production middleware/integrations.
[dependencies]
rustapi-rs = "0.1.335"use rustapi_rs::prelude::*;
#[rustapi_rs::get("/hello/{name}")]
async fn hello(Path(name): Path<String>) -> Json<Message> {
Json(Message { greeting: format!("Hello, {name}!") })
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
RustApi::auto().run("0.0.0.0:8080").await
}Visit http://localhost:8080/docs for auto-generated Swagger UI.
See crates/rustapi-rs/examples/README.md for the current in-repository example index.
Current examples in this repository:
typed_path_poc— Typed path registration and URI generationstatus_demo— Automatic status page demo with live traffic/error generation
- Recommended Production Baseline
- Production Checklist
- Cookbook: Graceful Shutdown
- Cookbook: Deployment
- Cookbook: Observability
- Cookbook: Replay Workflow
MIT or Apache-2.0, at your option.