Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 1, 2026·3 min de lecture

Salvo — Powerful Rust Web Framework with Built-In Features

Salvo is a Rust web framework built on Hyper and Tokio that provides a rich feature set including routing, middleware, WebSockets, TLS, HTTP/3, and OpenAPI generation in a single cohesive package.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Salvo Rust Framework
Commande d'installation directe
npx -y tokrepo@latest install 6072d394-7569-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Salvo is a Rust web framework that bundles routing, middleware, static file serving, WebSockets, TLS, and OpenAPI doc generation into one crate. Built on Hyper and Tokio, it targets developers who want a batteries-included framework without pulling in dozens of separate dependencies.

What Salvo Does

  • Routes requests using a tree-based router with path parameters and wildcards
  • Provides a #[handler] macro for ergonomic endpoint definitions
  • Supports middleware (called Handlers in Salvo) with before, after, and around semantics
  • Generates OpenAPI documentation from handler signatures and annotations
  • Serves static files, handles WebSocket upgrades, and supports HTTP/3 via QUIC

Architecture Overview

Salvo is layered on top of Hyper for HTTP parsing and Tokio for async I/O. Incoming connections are accepted by a listener (TCP, TLS, or QUIC), requests are dispatched through a tree router, and handlers execute as async functions returning types that implement the Scribe trait. The framework uses a depot (typed map) to pass data between handlers in a request pipeline.

Self-Hosting & Configuration

  • Requires Rust 1.75+ with Tokio runtime
  • Add salvo to Cargo.toml; feature flags enable TLS, HTTP/3, and OpenAPI
  • Configure listeners for plain TCP, Rustls TLS, or Quinn-based QUIC
  • Use Router::new() to build route trees with .push() for nesting
  • Deploy as a static binary; add a reverse proxy for edge TLS if preferred

Key Features

  • OpenAPI spec generation directly from handler code via the oapi feature
  • Built-in support for ACME (Let's Encrypt) automatic certificate provisioning
  • HTTP/3 and QUIC support without external proxies
  • Depot (typed map) shares data between middleware handlers within a request
  • Extractors parse query strings, JSON bodies, multipart forms, and path params

Comparison with Similar Tools

  • Actix Web — more mature ecosystem; Salvo has more built-in features like OpenAPI and HTTP/3
  • Axum — Tower-based extractor pattern; Salvo uses a handler macro and depot approach
  • Rocket — macro-heavy with Fairings; Salvo offers a flatter middleware model
  • Poem — similar batteries-included philosophy; Salvo adds HTTP/3 and ACME
  • Warp — filter combinators; Salvo uses conventional routing

FAQ

Q: How stable is Salvo for production use? A: Salvo has not reached 1.0 but is actively developed and used in production by early adopters. Pin your version in Cargo.toml to avoid breaking changes.

Q: Does Salvo support Tokio or async-std? A: Salvo is built on Tokio exclusively. It does not support async-std.

Q: How does OpenAPI generation work? A: Enable the oapi feature, annotate handlers with #[endpoint], and Salvo generates a JSON/YAML OpenAPI spec served at a configurable path.

Q: Can I use Salvo for WebSocket applications? A: Yes. Salvo includes WebSocket support via a built-in handler that upgrades HTTP connections.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires