Crates.io | axum_garde |
lib.rs | axum_garde |
version | 0.20.0 |
source | src |
created_at | 2023-04-02 14:59:54.03685 |
updated_at | 2024-07-05 09:47:15.2999 |
description | Axum integration for garde |
homepage | |
repository | https://github.com/jprochazk/garde |
max_upload_size | |
id | 828154 |
size | 75,758 |
Provide garde validation on your axum application.
The most important element on this library is WithValidation
, a composable
extractor
that performs validation over some payload contents.
For most validators to work, the application state should implement FromRef
for ()
:
#[derive(Clone)]
struct AppState;
impl axum::extract::FromRef<AppState> for () {
fn from_ref(_: &AppState) {}
}
Feature | Description | Default? |
---|---|---|
json |
Enables support for [axum::extract::Json ] |
✅ |
form |
Enables support for [axum::extract::Form ] |
✅ |
query |
Enables support for [axum::extract::Query ] |
✅ |
axum-extra |
Enables support for [axum_extra::extract::WithRejection ] and [axum_extra::extract::Cached ] |
❌ |
axum-extra-protobuf |
Enables support for [axum_extra::protobuf::Protobuf ] |
❌ |
axum-extra-query |
Enables support for [axum_extra::extract::Query ] |
❌ |
axum-yaml |
Enables support for [axum_yaml::Yaml ] |
❌ |
axum-msgpack |
Enables support for [axum_msgpack::MsgPack ] and [axum_msgpack::MsgPackRaw ] |
❌ |