Re-exports§
pub use models::common_result::CommonResult;pub use error::AppError;pub use redis::RedisClient;pub use anyhow;pub use askama;pub use dotenvy;pub use rust_embed;pub use salvo;pub use tokio;pub use serde_json;
Modules§
- affix_
state - Middleware for adding shared application state to the request context.
- common_
hoops - common_
test_ routers_ example - config
- db
- endpoint
- Enhanced of handler for generate OpenAPI documention.
- error
- handler
- Handler module for handle
Request. - models
- redis
- signal
- Asynchronous signal handling for Tokio.
- trailing_
slash - Trailing slash middleware.
- utils
Macros§
- info
- Constructs an event at the info level.
Structs§
- Acme
Listener - A wrapper around an underlying listener which implements the ACME.
- Basic
Auth - BasicAuth
- Caching
Headers - A combined handler that provides both
ETagandModifiedbehavior. - Catch
Panic - Middleware that catches panics in handlers and converts them to HTTP 500 responses.
- Catcher
Catcheris used to catch errors.- Compression
- Compression
- Depot
- Store temp data for current request.
- Empty
- Flow
Ctrl - Control the flow of execute handlers.
- Force
Https - Middleware for force redirect to http uri.
- Joined
Listener JoinedListeneris a listener that can join two listeners.- Json
- Write serializable content to response as json content.
- JwtAuth
- JWT Authentication middleware for Salvo.
- Keycert
- Private key and certificate
- Logger
- A simple logger middleware.
- Native
TlsListener - NativeTlsListener
- OpenApi
- Root object of the OpenAPI document.
- Openssl
Listener - OpensslListener
- Proxy
- Handler that can proxy request to other server.
- Quinn
Listener - A wrapper of
Listenerwith quinn. - RapiDoc
- Implements
Handlerfor serving RapiDoc. - ReDoc
- Implements
Handlerfor serving ReDoc. - Redirect
- Response that redirects the request to another location.
- Request
- Represents an HTTP request.
- Request
Id - A middleware for generate request id.
- Response
- Represents an HTTP response.
- Router
- Route request to different handlers.
- Rustls
Config - Builder to set the configuration for the Tls server.
- Rustls
Listener - A wrapper of
Listenerwith rustls. - Scalar
- Implements
Handlerfor serving Scalar. - Server
- HTTP Server.
- Server
Handle - Server handle is used to stop server.
- Service
- Service http request.
- Session
Handler SessionHandleris a middleware for session.- SseEvent
- Server-sent event
- SseKeep
Alive - SseKeepAlive
- Static
Dir - Handler that serves static files from directories.
- Static
File StaticFileis a handler that serves a single static file.- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.). - Status
Error - HTTP status error information.
- Swagger
Ui - Implements
Handlerfor serving Swagger UI. - TcpListener
TcpListeneris used to create a TCP connection listener.- Timeout
- Middleware for controlling request timeout.
- Trailing
Slash - TrailingSlash
- Unix
Listener UnixListeneris used to create a Unix socket connection listener.- WebSocket
Upgrade - Creates a WebSocket Handler. Request:
Enums§
- Compression
Algo - CompressionAlgo
- Compression
Level - Level of compression data should be compressed with.
- JwtAuth
State - Possible states of JWT authentication.
- Text
- Write text content to response as text content.
- Trailing
Slash Action - TrailingSlashAction
Traits§
- Basic
Auth Depot Ext - Extension trait for retrieving the authenticated username from a Depot.
- Basic
Auth Validator - Validator for Basic Authentication credentials.
- Csrf
Depot Ext - Extesion for Depot.
- Endpoint
ArgRegister - A trait for endpoint argument register.
- Endpoint
OutRegister - A trait for endpoint return type register.
- Handler
Handleris used for handleRequest.- JwtAuth
Depot Ext - Extension trait for accessing JWT authentication data from the depot.
- Listener
Listenerrepresents a listener that can bind to a specific address and port and return an acceptor.- Router
Ext - Router extension trait for openapi metadata.
- Scribe
Scribeis used to write data toResponse.- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- Session
Depot Ext - Trait for
Depotto get and set session. - Session
Store - An async session backend.
- ToParameter
- Trait used to give
Parameterinformation for OpenAPI. - ToParameters
- Trait used to convert implementing type to OpenAPI parameters.
- ToResponse
- This trait is implemented to document a type which represents a single response which can be referenced or reused as a component in multiple operations.
- ToResponses
- This trait is implemented to document a type (like an enum) which can represent multiple responses, to be used in operation.
- ToSchema
- Trait for implementing OpenAPI Schema object.
- Tower
Layer Compat - Trait for tower layer compat.
- Tower
Service Compat - Trait for tower service compat.
- Writer
Writeris used to write data toResponse.
Functions§
- empty_
ok - json_ok
- max_
concurrency - Create a new
MaxConcurrency. - shutdown_
signal
Type Aliases§
Attribute Macros§
- async_
trait - craft
#[craft]is an attribute macro that converts methods in animplblock intoSalvo’sHandlerimplementations.- endpoint
- Enhanced of handler for generate OpenAPI documention, Read more.
- handler
handleris a macro to help createHandlerfrom function or impl block easily.
Derive Macros§
- Extractible
- Generate code for extractible type.
- Serialize
- ToParameters
- Generate parameters from struct’s fields, Read more.
- ToResponse
- Generate reusable OpenApi response, Read more.
- ToResponses
- Generate responses with status codes what can be used in OpenAPI, Read more.
- ToSchema
- This is
#[derive]implementation forToSchematrait, Read more.