Expand description
Prelude module for convenient imports.
Import everything you need with:
ⓘ
use rust_api::prelude::*;§DI Note
Container is intentionally not in the prelude.
The primary DI mechanism is direct Arc<Service> passing to
RouterPipeline::mount. Import Container explicitly if you need a
registry for large apps: use rust_api::di::Container;
Re-exports§
pub use super::guard;pub use super::require_bearer;pub use super::router;pub use super::ApiRoute;pub use super::App;pub use super::Controller;pub use super::Error;pub use super::Result;pub use super::Router;pub use super::RouterExt;pub use super::RouterPipeline;pub use super::RouterTransform;pub use super::RustAPI;pub use tokio;
Modules§
- header
- HTTP header types
Macros§
- mount_
handlers - Generate a
Controllerimplementation for a type from a handler list.
Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Cors
Layer - Layer that applies the
Corsmiddleware which adds headers for CORS. - Json
- JSON Extractor / Response.
- Parts
- Component parts of an HTTP
Request - 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.
- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.). - Trace
Layer Layerthat adds high level tracing to aService.
Traits§
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- From
Request Parts - Types that can be created from request parts.
- Into
Response - 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::Responsewhose body type defaults toBody, 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