Module prelude

Module prelude 

Source
Expand description

Standard prelude to import needed tools at once.

Re-exports§

pub use crate::setup::GenericSetup;
pub use crate::setup::GenericValues;
pub use crate::setup::load_generic_config;
pub use crate::setup::load_generic_state;
pub use crate::startup::get_root_router;
pub use crate::startup::get_root_router_autoinject;
pub use crate::startup::start;
pub use crate::otel;
pub use impulse_utils;
pub use salvo;
pub use tracing;

Modules§

endpoint
Enhanced of handler for generate OpenAPI documentation.
handler
Handler module for handle Request.
instrument
Attach a span to a std::future::Future.

Macros§

file_upload
File response.
html
Returns given HTML code.
json
Serializes to JSON and returns given object.
msgpack
Serializes to MsgPack and returns given object.
ok
Returns empty 200 OK response.
plain
Returns given plain text.

Structs§

ClientError
Data structure responsible for client errors.
Depot
Store temp data for current request.
ErrorResponse
Public error message.
File
Sends 200 and file.
Html
Sends 200 and HTML.
Json
Sends 200 and JSON.
MsgPack
Sends 200 and MsgPack.
OK
Sends 200 without data.
Plain
Sends 200 and plain text.
Request
Represents an HTTP request.
Response
Represents an HTTP response.
Router
Route request to different handlers.
ServerError
Data structure responsible for server errors.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).

Traits§

CollectServerError
Trait to recover public errors from server.
MsgPackParser
MessagePack parser from salvo::Request.
MsgPackRequest
MessagePack writer to reqwest::RequestBuilder.
MsgPackResponse
Trait to parse MessagePack responses from reqwest library.
RedirectServerError
Trait to recover public errors from server.
SimdJsonParser
JSON parser from salvo::Request by sonic-rs.

Type Aliases§

CResult
Simple frontend result type.
MResult
Simple backend result type.

Attribute Macros§

endpoint
Enhanced of handler for generate OpenAPI documentation, Read more.
handler
handler is a macro to help create Handler from function or impl block easily.
instrument
Instruments a function to create and enter a tracing span every time the function is called.