Skip to main content

Crate salvo

Crate salvo 

Source
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

FeatureDescriptionDefault?
cookieSupport for Cookie✔️
serverBuilt-in Server implementation✔️
http1Support for HTTP 1.1 protocol✔️
http2Support for HTTP 2 protocol✔️
http2-cleartextSupport for HTTP 2 over cleartext TCP
quinnUse quinn to support HTTP 3 protocol
testUtilities for testing application✔️
acmeAutomatically obtain certificates through ACME
rustlsTLS built on rustls
opensslTLS built on openssl-tls
native-tlsTLS built on native-tls
unixListener based on Unix socket
tower-compatAdapters for tower::Layer and tower::Service
anyhowIntegrate with the anyhow crate
eyreIntegrate with the eyre crate
affix-stateMiddleware for adding shared application state to the request context
craftGenerate handlers or endpoints with shared data
basic-authMiddleware for basic authentication
caching-headersMiddleware for setting caching headers
catch-panicMiddleware for catching panics
concurrency-limiterMiddleware for limiting concurrency
force-httpsMiddleware for forcing HTTPS
loggingMiddleware for logging requests and responses
request-idMiddleware for setting a request ID
size-limiterMiddleware for limiting request size
sseServer-Sent Events (SSE) middleware
timeoutMiddleware for setting a timeout
trailing-slashMiddleware for handling trailing slashes
websocketWebSocket 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_acme as acme;acme
pub use salvo_oapi as oapi;oapi
pub use salvo_tus as tus;tus
pub use salvo_core as core;
pub use salvo_craft as craft;craft

Modules§

affix_stateaffix-state
Middleware for adding shared application state to the request context.
basic_authbasic-auth
Middleware for HTTP Basic Authentication.
caching_headerscaching-headers
Middleware for handling ETag and Last-Modified headers.
catch_paniccatch-panic
Middleware for catch panic in handlers.
catcher
Error catching and custom error page handling.
concurrency_limiterconcurrency-limiter
Middleware for limiting concurrency.
conn
Connection and listener implementations for handling HTTP connections.
extract
Extract is a feature to let you deserialize request to custom type.
force_httpsforce-https
Middleware force redirect to https.
fs
Filesystem utilities for serving files in HTTP responses.
fuse
Protection mechanisms against slow HTTP attacks and connection abuse.
handler
Handler module for handle Request.
http
HTTP types, request/response handling, and protocol utilities.
hyper
hyper
logginglogging
A simple logging middleware.
macros
The macros lib of Salvo web framework.
prelude
A list of things that automatically imports into application use salvo.
proto
Http protocol supports.
request_idrequest-id
Request id middleware.
routing
Routing and filters.
rt
Runtime module.
serverserver
Server module
size_limitersize-limiter
Middleware for limiting request size.
ssesse
Middleware for Server-Sent Events (SSE)
testtest
Utilities for testing application.
timeouttimeout
Middleware for controlling requests timeout.
trailing_slashtrailing-slash
Trailing slash middleware.
websocketwebsocket
WebSocket implementation.
writing
Writer trait and it’s implements.

Structs§

Depot
Store temp data for current request.
FlowCtrl
Control the flow of execute handlers.
Request
Represents an HTTP request.
Response
Represents an HTTP response.
Router
Route request to different handlers.
Server
HTTP Server.
Service
Service http request.

Enums§

Error
The main error type used throughout Salvo.

Traits§

Extractible
If a type implements this trait, it will give a metadata, this will help request to extracts data to this type.
Handler
Handler is used for handle Request.
Listener
A trait for types that can bind to an address and create an acceptor.
Scribe
Scribe is used to write data to Response.
Writer
Writer is used to write data to Response.

Type Aliases§

BoxedError
A boxed error type for dynamic error handling.
Result
Result type which has salvo::Error as its error type.

Attribute Macros§

async_trait
handler
handler is a macro to help create Handler from function or impl block easily.