Expand description
Salvo is a powerful web framework that can make your work easier.
salvo
uses a set of [feature flags] to reduce the amount of compiled and
optional dependencies.
§Feature flags
Feature | Description | Default? |
---|---|---|
cookie | Support for Cookie | ✔️ |
server | Built-in Server implementation | ✔️ |
http1 | Support for HTTP 1.1 protocol | ✔️ |
http2 | Support for HTTP 2 protocol | ✔️ |
http2-cleartext | Support for HTTP 2 over cleartext TCP | ❌ |
quinn | Use quinn to support HTTP 3 protocol | ❌ |
test | Utilities for testing application | ✔️ |
acme | Automatically obtain certificates through ACME | ❌ |
rustls | TLS built on rustls | ❌ |
openssl | TLS built on openssl-tls | ❌ |
native-tls | TLS built on native-tls | ❌ |
unix | Listener based on unix socket | ❌ |
tower-compat | Adapters for tower::Layer and tower::Service | ❌ |
anyhow | Integrate with the anyhow crate | ❌ |
eyre | Integrate with the eyre crate | ❌ |
affix-state | Middleware for adding prefix and suffix to the request path | ❌ |
basic-auth | Middleware for basic authentication | ❌ |
caching-headers | Middleware for setting caching headers | ❌ |
catch-panic | Middleware for catching panics | ❌ |
concurrency-limiter | Middleware for limiting concurrency | ❌ |
force-https | Middleware for forcing HTTPS | ❌ |
logging | Middleware for logging requests and responses | ❌ |
request-id | Middleware for setting a request ID | ❌ |
size-limiter | Middleware for limiting request size | ❌ |
sse | Server-Sent Events (SSE) middleware | ❌ |
timeout | Middleware for setting a timeout | ❌ |
trailing-slash | Middleware for handling trailing slashes | ❌ |
websocket | WebSocket implementation | ❌ |
Re-exports§
pub use salvo_cache as cache;
cache
pub use salvo_compression as compression;
compression
pub use salvo_cors as cors;
cors
pub use salvo_csrf as csrf;
csrf
pub use salvo_flash as flash;
flash
pub use salvo_jwt_auth as jwt_auth;
jwt-auth
pub use salvo_proxy as proxy;
proxy
pub use salvo_rate_limiter as rate_limiter;
rate-limiter
pub use salvo_session as session;
session
pub use salvo_serve_static as serve_static;
serve-static
pub use salvo_otel as otel;
otel
pub use salvo_oapi as oapi;
oapi
pub use salvo_core as core;
Modules§
- affix_
state affix-state
Middleware for add any data to depot. - basic_
auth basic-auth
Middleware for basic authentication. - caching_
headers caching-headers
Middleware for etag and last-modified-since headers. - catch_
panic catch-panic
Middleware for catch panic in handlers. - Catch and handle errors.
- concurrency_
limiter concurrency-limiter
Middleware for limit concurrency. - Various listener implementations for handling HTTP connections.
- Extract is a feature to let you deserialize request to custom type.
- force_
https force-https
Middleware force redirect to https. - Filesystem module
- Protecting the server from slow HTTP attacks.
- Handler module for handle
Request
. - The HTTP related types and functions.
- hyper
- logging
logging
A simple logging middleware. - The macros lib of Savlo web framework.
- A list of things that automatically imports into application use salvo.
- Http protocol supports.
- request_
id request-id
Request id middleware. - Routing and filters.
- Runtime module.
- Server module
- size_
limiter size-limiter
Middleware for limiting request size. - sse
sse
Middleware for Server-Sent Events (SSE) - Utilities for testing application.
- timeout
timeout
Middleware for controlling requests timeout. - trailing_
slash trailing-slash
Trailing slash middleware. - websocket
websocket
WebSocket implementation. - Writer trait and it’s implements.
Structs§
- Store temp data for current request.
- Control the flow of execute handlers.
- Represents an HTTP request.
- Represents an HTTP response.
- Route request to different handlers.
- HTTP Server.
- Service http request.
Enums§
- Errors that can happen inside salvo.
Traits§
- If a type implements this trait, it will give a metadata, this will help request to extracts data to this type.
Handler
is used for handleRequest
.Listener
represents a listener that can bind to a specific address and port and return an acceptor.Scribe
is used to write data toResponse
.Writer
is used to write data toResponse
.
Type Aliases§
BoxedError
is a boxed error type that can be used as a trait object.- Result type which has
salvo::Error
as it’s error type.
Attribute Macros§
handler
is a macro to help createHandler
from function or impl block easily.