axum_core/
lib.rs

1//! Core types and traits for [`axum`].
2//!
3//! Libraries authors that want to provide [`FromRequest`] or [`IntoResponse`] implementations
4//! should depend on the [`axum-core`] crate, instead of `axum` if possible.
5//!
6//! [`FromRequest`]: crate::extract::FromRequest
7//! [`IntoResponse`]: crate::response::IntoResponse
8//! [`axum`]: https://crates.io/crates/axum
9//! [`axum-core`]: http://crates.io/crates/axum-core
10
11#![cfg_attr(test, allow(clippy::float_cmp))]
12#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))]
13
14#[macro_use]
15pub(crate) mod macros;
16#[doc(hidden)] // macro helpers
17pub mod __private {
18    #[cfg(feature = "tracing")]
19    pub use tracing;
20}
21
22mod error;
23mod ext_traits;
24pub use self::error::Error;
25
26pub mod body;
27pub mod extract;
28pub mod response;
29
30/// Alias for a type-erased error type.
31pub type BoxError = Box<dyn std::error::Error + Send + Sync>;
32
33pub use self::ext_traits::{request::RequestExt, request_parts::RequestPartsExt};
34
35#[cfg(test)]
36use axum_macros::__private_axum_test as test;