mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
axum-extra: Make axum optional dependency (#3485)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! See [`CookieJar`], [`SignedCookieJar`], and [`PrivateCookieJar`] for more details.
|
||||
|
||||
use axum::{
|
||||
use axum_core::{
|
||||
extract::FromRequestParts,
|
||||
response::{IntoResponse, IntoResponseParts, Response, ResponseParts},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::{cookies_from_request, set_cookies, Cookie, Key};
|
||||
use axum::{
|
||||
use axum_core::{
|
||||
extract::{FromRef, FromRequestParts},
|
||||
response::{IntoResponse, IntoResponseParts, Response, ResponseParts},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::{cookies_from_request, set_cookies};
|
||||
use axum::{
|
||||
use axum_core::{
|
||||
extract::{FromRef, FromRequestParts},
|
||||
response::{IntoResponse, IntoResponseParts, Response, ResponseParts},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::rejection::{FailedToResolveHost, HostRejection};
|
||||
use axum::{
|
||||
use axum_core::{
|
||||
extract::{FromRequestParts, OptionalFromRequestParts},
|
||||
RequestPartsExt,
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use axum::extract::{FromRequest, Request};
|
||||
use axum_core::__composite_rejection as composite_rejection;
|
||||
use axum_core::__define_rejection as define_rejection;
|
||||
use axum_core::extract::rejection::BytesRejection;
|
||||
use axum_core::extract::{FromRequest, Request};
|
||||
use bytes::Bytes;
|
||||
use http::{header, HeaderMap};
|
||||
use serde_core::Deserialize;
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
//! Additional extractors.
|
||||
|
||||
mod cached;
|
||||
mod host;
|
||||
mod optional_path;
|
||||
pub mod rejection;
|
||||
|
||||
#[cfg(feature = "optional-path")]
|
||||
mod optional_path;
|
||||
|
||||
#[cfg(feature = "cached")]
|
||||
mod cached;
|
||||
|
||||
#[cfg(feature = "with-rejection")]
|
||||
mod with_rejection;
|
||||
|
||||
#[cfg(feature = "form")]
|
||||
@@ -25,8 +31,16 @@ pub mod multipart;
|
||||
mod scheme;
|
||||
|
||||
#[allow(deprecated)]
|
||||
#[cfg(feature = "optional-path")]
|
||||
pub use self::optional_path::OptionalPath;
|
||||
pub use self::{cached::Cached, host::Host, with_rejection::WithRejection};
|
||||
|
||||
pub use self::host::Host;
|
||||
|
||||
#[cfg(feature = "cached")]
|
||||
pub use self::cached::Cached;
|
||||
|
||||
#[cfg(feature = "with-rejection")]
|
||||
pub use self::with_rejection::WithRejection;
|
||||
|
||||
#[cfg(feature = "cookie")]
|
||||
pub use self::cookie::CookieJar;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
//!
|
||||
//! See [`Multipart`] for more details.
|
||||
|
||||
use axum::{
|
||||
body::{Body, Bytes},
|
||||
use axum_core::{
|
||||
RequestExt, __composite_rejection as composite_rejection,
|
||||
__define_rejection as define_rejection,
|
||||
body::Body,
|
||||
extract::FromRequest,
|
||||
response::{IntoResponse, Response},
|
||||
RequestExt,
|
||||
};
|
||||
use axum_core::__composite_rejection as composite_rejection;
|
||||
use axum_core::__define_rejection as define_rejection;
|
||||
use bytes::Bytes;
|
||||
use futures_core::stream::Stream;
|
||||
use http::{
|
||||
header::{HeaderMap, CONTENT_TYPE},
|
||||
@@ -284,7 +284,7 @@ fn status_code_from_multer_error(err: &multer::Error) -> StatusCode {
|
||||
}
|
||||
|
||||
if err
|
||||
.downcast_ref::<axum::Error>()
|
||||
.downcast_ref::<axum_core::Error>()
|
||||
.and_then(|err| err.source())
|
||||
.and_then(|err| err.downcast_ref::<http_body_util::LengthLimitError>())
|
||||
.is_some()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use axum::extract::FromRequestParts;
|
||||
use axum_core::__composite_rejection as composite_rejection;
|
||||
use axum_core::__define_rejection as define_rejection;
|
||||
use axum_core::extract::FromRequestParts;
|
||||
use http::{request::Parts, Uri};
|
||||
use serde_core::de::DeserializeOwned;
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
//! Extractor that parses the scheme of a request.
|
||||
//! See [`Scheme`] for more details.
|
||||
|
||||
use axum::extract::FromRequestParts;
|
||||
use axum_core::__define_rejection as define_rejection;
|
||||
use axum_core::{__define_rejection as define_rejection, extract::FromRequestParts};
|
||||
use http::{
|
||||
header::{HeaderMap, FORWARDED},
|
||||
request::Parts,
|
||||
|
||||
Reference in New Issue
Block a user