Crate daoyi_cloud_common

Crate daoyi_cloud_common 

Source

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;
pub use cookie;

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§

AcmeListener
A wrapper around an underlying listener which implements the ACME.
BasicAuth
BasicAuth
CachingHeaders
A combined handler that provides both ETag and Modified behavior.
CatchPanic
Middleware that catches panics in handlers and converts them to HTTP 500 responses.
Catcher
Catcher is used to catch errors.
Compression
Compression
Depot
Store temp data for current request.
Empty
FlowCtrl
Control the flow of execute handlers.
ForceHttps
Middleware for force redirect to http uri.
JoinedListener
JoinedListener is 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.
NativeTlsListener
NativeTlsListener
OpenApi
Root object of the OpenAPI document.
OpensslListener
OpensslListener
Proxy
Handler that can proxy request to other server.
QuinnListener
A wrapper of Listener with quinn.
RapiDoc
Implements Handler for serving RapiDoc.
ReDoc
Implements Handler for serving ReDoc.
Redirect
Response that redirects the request to another location.
Request
Represents an HTTP request.
RequestId
A middleware for generate request id.
Response
Represents an HTTP response.
Router
Route request to different handlers.
RustlsConfig
Builder to set the configuration for the Tls server.
RustlsListener
A wrapper of Listener with rustls.
Scalar
Implements Handler for serving Scalar.
Server
HTTP Server.
ServerHandle
Server handle is used to stop server.
Service
Service http request.
SessionHandler
SessionHandler is a middleware for session.
SseEvent
Server-sent event
SseKeepAlive
SseKeepAlive
StaticDir
Handler that serves static files from directories.
StaticFile
StaticFile is a handler that serves a single static file.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
StatusError
HTTP status error information.
SwaggerUi
Implements Handler for serving Swagger UI.
TcpListener
TcpListener is used to create a TCP connection listener.
Timeout
Middleware for controlling request timeout.
TrailingSlash
TrailingSlash
UnixListener
UnixListener is used to create a Unix socket connection listener.
WebSocketUpgrade
Creates a WebSocket Handler. Request:

Enums§

CompressionAlgo
CompressionAlgo
CompressionLevel
Level of compression data should be compressed with.
JwtAuthState
Possible states of JWT authentication.
Text
Write text content to response as text content.
TrailingSlashAction
TrailingSlashAction

Traits§

BasicAuthDepotExt
Extension trait for retrieving the authenticated username from a Depot.
BasicAuthValidator
Validator for Basic Authentication credentials.
CsrfDepotExt
Extesion for Depot.
EndpointArgRegister
A trait for endpoint argument register.
EndpointOutRegister
A trait for endpoint return type register.
Handler
Handler is used for handle Request.
JwtAuthDepotExt
Extension trait for accessing JWT authentication data from the depot.
Listener
Listener represents a listener that can bind to a specific address and port and return an acceptor.
RouterExt
Router extension trait for openapi metadata.
Scribe
Scribe is used to write data to Response.
Serialize
A data structure that can be serialized into any data format supported by Serde.
SessionDepotExt
Trait for Depot to get and set session.
SessionStore
An async session backend.
ToParameter
Trait used to give Parameter information 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.
TowerLayerCompat
Trait for tower layer compat.
TowerServiceCompat
Trait for tower service compat.
Writer
Writer is used to write data to Response.

Functions§

empty_ok
json_ok
max_concurrency
Create a new MaxConcurrency.
shutdown_signal

Type Aliases§

AppResult
EmptyResult
JsonResult

Attribute Macros§

async_trait
craft
#[craft] is an attribute macro that converts methods in an impl block into Salvo’s Handler implementations.
endpoint
Enhanced of handler for generate OpenAPI documention, Read more.
handler
handler is a macro to help create Handler from 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 for ToSchema trait, Read more.