Merge pull request #29 from MrAliSalehi/main

axum 0.8
This commit is contained in:
GengTeng
2025-01-25 20:59:59 +08:00
committed by GitHub
4 changed files with 6 additions and 23 deletions

View File

@@ -25,13 +25,13 @@ edition = "2021"
features = ["full", "aide"] features = ["full", "aide"]
[dependencies] [dependencies]
axum = { version = "0.7.5", default-features = false } axum = { version = "0.8", default-features = false }
garde = { version = "0.20.0", optional = true } garde = { version = "0.21.0", optional = true }
validator = { version = "0.19.0", optional = true } validator = { version = "0.19.0", optional = true }
validify = { version = "1.4.0", optional = true } validify = { version = "1.4.0", optional = true }
[dependencies.axum-extra] [dependencies.axum-extra]
version = "0.9.3" version = "0.10"
default-features = false default-features = false
optional = true optional = true
@@ -40,7 +40,7 @@ version = "0.7.0"
optional = true optional = true
[dependencies.axum_typed_multipart] [dependencies.axum_typed_multipart]
version = "0.13.1" version = "0.14"
optional = true optional = true
[dependencies.serde] [dependencies.serde]
@@ -53,12 +53,12 @@ optional = true
[dev-dependencies] [dev-dependencies]
anyhow = "1.0.87" anyhow = "1.0.87"
axum = { version = "0.7.5", features = ["macros"] } axum = { version = "0.8", features = ["macros"] }
tokio = { version = "1.34.0", features = ["full"] } tokio = { version = "1.34.0", features = ["full"] }
reqwest = { version = "0.12.3", features = ["json", "multipart"] } reqwest = { version = "0.12.3", features = ["json", "multipart"] }
serde = { version = "1.0.195", features = ["derive"] } serde = { version = "1.0.195", features = ["derive"] }
validator = { version = "0.19.0", features = ["derive"] } validator = { version = "0.19.0", features = ["derive"] }
garde = { version = "0.20.0", features = ["serde", "derive"] } garde = { version = "0.21.0", features = ["serde", "derive"] }
serde_json = "1.0.108" serde_json = "1.0.108"
serde_yaml = "0.9.27" serde_yaml = "0.9.27"
quick-xml = { version = "0.36.1", features = ["serialize"] } quick-xml = { version = "0.36.1", features = ["serialize"] }

View File

@@ -9,7 +9,6 @@
pub mod test; pub mod test;
use crate::{HasValidate, ValidationRejection}; use crate::{HasValidate, ValidationRejection};
use axum::async_trait;
use axum::extract::{FromRef, FromRequest, FromRequestParts, Request}; use axum::extract::{FromRef, FromRequest, FromRequestParts, Request};
use axum::http::request::Parts; use axum::http::request::Parts;
use garde::{Report, Validate}; use garde::{Report, Validate};
@@ -77,7 +76,6 @@ impl<E> From<Report> for GardeRejection<E> {
} }
} }
#[async_trait]
impl<State, Extractor, Context> FromRequest<State> for Garde<Extractor> impl<State, Extractor, Context> FromRequest<State> for Garde<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -98,7 +96,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor, Context> FromRequestParts<State> for Garde<Extractor> impl<State, Extractor, Context> FromRequestParts<State> for Garde<Extractor>
where where
State: Send + Sync, State: Send + Sync,

View File

@@ -9,7 +9,6 @@
pub mod test; pub mod test;
use crate::{HasValidate, ValidationRejection}; use crate::{HasValidate, ValidationRejection};
use axum::async_trait;
use axum::extract::{FromRef, FromRequest, FromRequestParts, Request}; use axum::extract::{FromRef, FromRequest, FromRequestParts, Request};
use axum::http::request::Parts; use axum::http::request::Parts;
use std::fmt::Display; use std::fmt::Display;
@@ -144,7 +143,6 @@ pub trait HasValidateArgs<'v> {
fn get_validate_args(&self) -> &Self::ValidateArgs; fn get_validate_args(&self) -> &Self::ValidateArgs;
} }
#[async_trait]
impl<State, Extractor> FromRequest<State> for Valid<Extractor> impl<State, Extractor> FromRequest<State> for Valid<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -162,7 +160,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequestParts<State> for Valid<Extractor> impl<State, Extractor> FromRequestParts<State> for Valid<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -180,7 +177,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor, Args> FromRequest<State> for ValidEx<Extractor> impl<State, Extractor, Args> FromRequest<State> for ValidEx<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -201,7 +197,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor, Args> FromRequestParts<State> for ValidEx<Extractor> impl<State, Extractor, Args> FromRequestParts<State> for ValidEx<Extractor>
where where
State: Send + Sync, State: Send + Sync,

View File

@@ -9,7 +9,6 @@
pub mod test; pub mod test;
use crate::{HasValidate, ValidationRejection}; use crate::{HasValidate, ValidationRejection};
use axum::async_trait;
use axum::extract::{FromRequest, FromRequestParts, Request}; use axum::extract::{FromRequest, FromRequestParts, Request};
use axum::http::request::Parts; use axum::http::request::Parts;
use axum::response::{IntoResponse, Response}; use axum::response::{IntoResponse, Response};
@@ -301,7 +300,6 @@ pub trait HasValidify: Sized {
fn from_validify(v: Self::Validify) -> Self; fn from_validify(v: Self::Validify) -> Self;
} }
#[async_trait]
impl<State, Extractor> FromRequest<State> for Validated<Extractor> impl<State, Extractor> FromRequest<State> for Validated<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -319,7 +317,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequestParts<State> for Validated<Extractor> impl<State, Extractor> FromRequestParts<State> for Validated<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -337,7 +334,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequest<State> for Modified<Extractor> impl<State, Extractor> FromRequest<State> for Modified<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -352,7 +348,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequestParts<State> for Modified<Extractor> impl<State, Extractor> FromRequestParts<State> for Modified<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -367,7 +362,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequest<State> for Validified<Extractor> impl<State, Extractor> FromRequest<State> for Validified<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -387,7 +381,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequestParts<State> for Validified<Extractor> impl<State, Extractor> FromRequestParts<State> for Validified<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -407,7 +400,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequest<State> for ValidifiedByRef<Extractor> impl<State, Extractor> FromRequest<State> for ValidifiedByRef<Extractor>
where where
State: Send + Sync, State: Send + Sync,
@@ -426,7 +418,6 @@ where
} }
} }
#[async_trait]
impl<State, Extractor> FromRequestParts<State> for ValidifiedByRef<Extractor> impl<State, Extractor> FromRequestParts<State> for ValidifiedByRef<Extractor>
where where
State: Send + Sync, State: Send + Sync,