Skip to main content

Module prelude

Module prelude 

Source
Expand description

Prelude module for convenient imports

Import everything you need with:

use rust_api::prelude::*;

Re-exports§

pub use super::Container;
pub use super::Injectable;
pub use super::App;
pub use super::Error;
pub use super::Result;
pub use super::Router;
pub use super::RouterExt;
pub use super::RustAPI;
pub use super::router;
pub use super::routing;
pub use tokio;

Structs§

CorsLayer
Layer that applies the Cors middleware which adds headers for CORS.
Json
JSON Extractor / Response.
Path
Extractor that will get captures from the URL and parse them using serde.
Query
Extractor that deserializes query strings into some type.
State
Extractor for state.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
TraceLayer
Layer that adds high level tracing to a Service.

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
IntoResponse
Trait for generating responses.
Serialize
A data structure that can be serialized into any data format supported by Serde.

Type Aliases§

Response
Type alias for http::Response whose body type defaults to Body, the most common body type used with axum.

Attribute Macros§

delete
Define a DELETE route handler
get
Define a GET route handler
patch
Define a PATCH route handler
post
Define a POST route handler
put
Define a PUT route handler

Derive Macros§

Deserialize
Serialize