Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

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 prefix and suffix to the request path
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_oapi as oapi;oapi
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
Catch and handle errors.
concurrency_limiterconcurrency-limiter
Middleware for limiting concurrency.
conn
Various 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 module
fuse
Protecting the server from slow HTTP attacks.
handler
Handler module for handle Request.
http
The HTTP related types and functions.
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.
server
Server module
size_limitersize-limiter
Middleware for limiting request size.
ssesse
Middleware for Server-Sent Events (SSE)
test
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
Errors that can happen inside 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
Listener represents a listener that can bind to a specific address and port and return an acceptor.
Scribe
Scribe is used to write data to Response.
Writer
Writer is used to write data to Response.

Type Aliases§

BoxedError
BoxedError is a boxed error type that can be used as a trait object.
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.