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

@@ -61,8 +61,11 @@
//! }
//! ```
use crate::{HasValidate, HasValidateArgs};
use crate::HasValidate;
#[cfg(feature = "validator")]
use crate::HasValidateArgs;
use axum::TypedHeader;
#[cfg(feature = "validator")]
use validator::ValidateArgs;
impl<T> HasValidate for TypedHeader<T> {
@@ -72,6 +75,7 @@ impl<T> HasValidate for TypedHeader<T> {
}
}
#[cfg(feature = "validator")]
impl<'v, T: ValidateArgs<'v>> HasValidateArgs<'v> for TypedHeader<T> {
type ValidateArgs = T;
fn get_validate_args(&self) -> &Self::ValidateArgs {