This commit is contained in:
gengteng
2023-10-08 14:34:26 +08:00
parent 2f1aa1060f
commit dd68fe6131
19 changed files with 489 additions and 382 deletions

View File

@@ -12,6 +12,7 @@
//! ## Example
//!
//! ```no_run
//!
//! use axum::extract::Query;
//! use axum::routing::post;
//! use axum::Router;
@@ -41,8 +42,11 @@
//! }
//! ```
use crate::{HasValidate, HasValidateArgs};
use crate::HasValidate;
#[cfg(feature = "validator")]
use crate::HasValidateArgs;
use axum::extract::Query;
#[cfg(feature = "validator")]
use validator::ValidateArgs;
impl<T> HasValidate for Query<T> {
@@ -52,6 +56,7 @@ impl<T> HasValidate for Query<T> {
}
}
#[cfg(feature = "validator")]
impl<'v, T: ValidateArgs<'v>> HasValidateArgs<'v> for Query<T> {
type ValidateArgs = T;
fn get_validate_args(&self) -> &Self::ValidateArgs {