| Crates.io | rustapi-rs |
| lib.rs | rustapi-rs |
| version | 0.1.207 |
| created_at | 2025-12-30 14:50:56.644004+00 |
| updated_at | 2026-01-26 00:04:23.642602+00 |
| description | A FastAPI-like web framework for Rust - DX-first, type-safe, batteries included |
| homepage | |
| repository | https://github.com/Tuntii/RustAPI |
| max_upload_size | |
| id | 2012763 |
| size | 141,061 |
RustAPI brings the developer experience (DX) of modern frameworks like FastAPI to the Rust ecosystem.
We believe that writing high-performance, type-safe web APIs in Rust shouldn't require fighting with complex trait bounds or massive boilerplate. RustAPI provides a polished, battery-included experience where:
tokio, hyper, and matchit internally, but we expose a stable, user-centric API.tokio and hyper 1.0.Json, Query, Path).#[derive(Validate)].Add rustapi-rs to your Cargo.toml.
[dependencies]
rustapi-rs = { version = "0.1", features = ["full"] }
use rustapi_rs::prelude::*;
/// Define your response schema
#[derive(Serialize, Schema)]
struct HelloResponse {
message: String,
}
/// Define an endpoint
#[rustapi::get("/")]
#[rustapi::tag("General")]
#[rustapi::summary("Hello World Endpoint")]
async fn hello() -> Json<HelloResponse> {
Json(HelloResponse {
message: "Hello from RustAPI!".to_string(),
})
}
/// Run the server
#[rustapi::main]
async fn main() -> Result<()> {
RustApi::new()
.api_name("My Awesome API")
.api_version("1.0.0")
.mount_route(hello_route()) // Auto-generated route handler
.docs("/docs") // Enable Swagger UI
.run("127.0.0.1:8080")
.await
}
Visit http://127.0.0.1:8080/docs to see your interactive API documentation!
RustAPI follows a Facade Architecture:
rustapi-rs: The public-facing entry point. Always import from here.rustapi-core: The internal engine (Hyper/Tower).rustapi-macros: Procedural macros (#[get], #[main]).cargo-rustapi: The CLI tool for scaffolding projects.We welcome contributions! Please see CONTRIBUTING.md for details.
This project is licensed under either of
at your option.