mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Remove tower from axum's public API (#229)
Instead rely on `tower-service` and `tower-layer`. `tower` itself is only used internally. Fixes https://github.com/tokio-rs/axum/issues/186
This commit is contained in:
@@ -14,8 +14,8 @@ use std::{
|
||||
net::SocketAddr,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower::Service;
|
||||
use tower_http::add_extension::AddExtension;
|
||||
use tower_service::Service;
|
||||
|
||||
/// A [`MakeService`] created from a router.
|
||||
///
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
//! See [`extractor_middleware`] for more details.
|
||||
|
||||
use super::{FromRequest, RequestParts};
|
||||
use crate::BoxError;
|
||||
use crate::{body::BoxBody, response::IntoResponse};
|
||||
use bytes::Bytes;
|
||||
use futures_util::{future::BoxFuture, ready};
|
||||
@@ -15,7 +16,8 @@ use std::{
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower::{BoxError, Layer, Service};
|
||||
use tower_layer::Layer;
|
||||
use tower_service::Service;
|
||||
|
||||
/// Convert an extractor into a middleware.
|
||||
///
|
||||
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
use super::{has_content_type, rejection::*, take_body, FromRequest, RequestParts};
|
||||
use crate::BoxError;
|
||||
use async_trait::async_trait;
|
||||
use bytes::Buf;
|
||||
use http::Method;
|
||||
use serde::de::DeserializeOwned;
|
||||
use std::ops::Deref;
|
||||
use tower::BoxError;
|
||||
|
||||
/// Extractor that deserializes `application/x-www-form-urlencoded` requests
|
||||
/// into some type.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
//! See [`Multipart`] for more details.
|
||||
|
||||
use super::{rejection::*, BodyStream, FromRequest, RequestParts};
|
||||
use crate::BoxError;
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use futures_util::stream::Stream;
|
||||
@@ -13,7 +14,6 @@ use std::{
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower::BoxError;
|
||||
|
||||
/// Extractor that parses `multipart/form-data` requests commonly used with file uploads.
|
||||
///
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//! Rejection response types.
|
||||
|
||||
use super::IntoResponse;
|
||||
use crate::BoxError;
|
||||
use crate::{
|
||||
body::{box_body, BoxBody},
|
||||
Error,
|
||||
@@ -8,7 +9,6 @@ use crate::{
|
||||
use bytes::Bytes;
|
||||
use http_body::Full;
|
||||
use std::convert::Infallible;
|
||||
use tower::BoxError;
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use super::{rejection::*, take_body, Extension, FromRequest, RequestParts};
|
||||
use crate::BoxError;
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use futures_util::stream::Stream;
|
||||
@@ -8,7 +9,6 @@ use std::{
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower::BoxError;
|
||||
|
||||
#[async_trait]
|
||||
impl<B> FromRequest<B> for Request<B>
|
||||
|
||||
Reference in New Issue
Block a user