Re-export middleware::from_fn from axum-extra to avoid making breaking changes

This commit is contained in:
David Pedersen
2022-02-22 13:33:10 +01:00
parent 6d821d2a23
commit 0b987c45c7
2 changed files with 21 additions and 0 deletions
+15
View File
@@ -46,3 +46,18 @@
pub mod extract;
pub mod response;
pub mod routing;
pub mod middleware {
//! Additional types for creating middleware.
pub use axum::middleware::{from_fn, Next};
pub mod middleware_fn {
//! Create middleware from async functions.
pub use axum::middleware::{
from_fn, futures::FromFnResponseFuture as ResponseFuture, FromFn as MiddlewareFn,
FromFnLayer as MiddlewareFnLayer, Next,
};
}
}
+6
View File
@@ -3,3 +3,9 @@
mod from_fn;
pub use self::from_fn::{from_fn, FromFn, FromFnLayer, Next};
pub mod futures {
//! Future types.
pub use super::from_fn::ResponseFuture as FromFnResponseFuture;
}