update
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "axum-valid"
|
name = "axum-valid"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
description = "Validator for axum"
|
description = "Validation tools for axum using the validator library."
|
||||||
authors = ["GengTeng <me@gteng.org>"]
|
authors = ["GengTeng <me@gteng.org>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
homepage = "https://github.com/gengteng/axum-valid"
|
homepage = "https://github.com/gengteng/axum-valid"
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#![doc = include_str!("../README.md")]
|
||||||
|
#![deny(unsafe_code, missing_docs, clippy::unwrap_used)]
|
||||||
|
|
||||||
use axum::extract::rejection::{FormRejection, JsonRejection, PathRejection, QueryRejection};
|
use axum::extract::rejection::{FormRejection, JsonRejection, PathRejection, QueryRejection};
|
||||||
use axum::extract::{FromRequest, FromRequestParts, Path, Query};
|
use axum::extract::{FromRequest, FromRequestParts, Path, Query};
|
||||||
use axum::http::request::Parts;
|
use axum::http::request::Parts;
|
||||||
@@ -13,7 +16,9 @@ pub struct Valid<T>(pub T);
|
|||||||
/// If the valid extractor fails it'll use this "rejection" type.
|
/// If the valid extractor fails it'll use this "rejection" type.
|
||||||
/// This rejection type can be converted into a response.
|
/// This rejection type can be converted into a response.
|
||||||
pub enum ValidRejection<E> {
|
pub enum ValidRejection<E> {
|
||||||
|
/// Validation errors
|
||||||
Valid(ValidationErrors),
|
Valid(ValidationErrors),
|
||||||
|
/// Inner extractor error
|
||||||
Inner(E),
|
Inner(E),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user