Expand description
§Autumn
An opinionated, convention-over-configuration web framework for Rust.
Autumn assembles proven Rust crates (Axum, Maud, Diesel, htmx, Tailwind) into a Spring Boot-style developer experience with proc-macro-driven conventions and escape hatches at every level.
§Quick start
use autumn_web::prelude::*;
#[get("/")]
async fn index() -> Markup {
html! { h1 { "Hello, Autumn!" } }
}
#[autumn_web::main]
async fn main() {
autumn_web::app()
.routes(routes![index])
.run()
.await;
}§Architecture overview
| Layer | Crate | Purpose |
|---|---|---|
| HTTP server | Axum | Routing, extractors, middleware |
| HTML templates | Maud | Type-safe, compiled HTML via html! macro |
| Database | Diesel | Async Postgres via diesel-async + deadpool |
| Client interactivity | htmx | Embedded JS served at /static/js/htmx.min.js |
| Styling | Tailwind CSS | Downloaded + managed by autumn-cli |
§Modules
app– Application builder for configuring and launching the server.config– Layered configuration: defaults,autumn.toml, env overrides.db– Database connection pool and theDbrequest extractor.error– Framework error type (AutumnError) and result alias.extract– Re-exported Axum extractors (Form,Json,Path,Query).health– Auto-mounted health check endpoint.logging– Structured logging viatracing-subscriber.middleware– Built-in middleware (request IDs).prelude– Glob import for the most common types.route– Route descriptor used by macro-generated code.
§Zero-config defaults
An Autumn app runs out of the box with no configuration file. Every
setting has a sensible default (port 3000, info log level, etc.).
Override via autumn.toml or AUTUMN_* environment variables.
See config::AutumnConfig for the full list.
Re-exports§
pub use app::app;pub use db::Db;pub use error::AutumnError;pub use error::AutumnResult;
Modules§
- app
- Application builder – the entry point for configuring and running an Autumn server.
- config
- Framework configuration with sensible defaults.
- db
- Database connection pool and extractor.
- error
- Framework error type and result alias.
- extract
- Re-exports of Axum extractors for use in Autumn handlers.
- health
- Health check endpoint.
- logging
- Structured logging initialization via
tracing-subscriber. - middleware
- Built-in middleware for Autumn applications.
- prelude
- Convenience re-exports for Autumn applications.
- reexports
- Re-exports of upstream crates used in macro-generated code.
- route
- Route descriptor types used by macro-generated code.
Macros§
Structs§
- AppState
- Shared application state passed to all route handlers.
- Json
- JSON request body extractor and response type.
- PreEscaped
- Wrap a pre-escaped string so Maud renders it verbatim.
Constants§
- HTMX_
VERSION - htmx version string embedded in the binary.
Type Aliases§
Attribute Macros§
- delete
- Annotate an async function as a
DELETEroute handler. - get
- Annotate an async function as a
GETroute handler. - main
- Set up the Tokio async runtime for an Autumn application.
- model
- Derive Diesel and Serde traits for a database model struct.
- post
- Annotate an async function as a
POSTroute handler. - put
- Annotate an async function as a
PUTroute handler.