Add axum::Error (#150)

Replace `BoxStdError` and supports downcasting
This commit is contained in:
David Pedersen
2021-08-07 19:56:44 +02:00
committed by GitHub
parent 4792d0c15c
commit 75b5615ccd
12 changed files with 88 additions and 65 deletions
+6 -3
View File
@@ -134,7 +134,7 @@
//!
//! ```rust
//! use axum::{prelude::*, body::BoxBody};
//! use tower::{Service, ServiceExt, BoxError};
//! use tower::{Service, ServiceExt};
//! use http::{Method, Response, StatusCode};
//! use std::convert::Infallible;
//!
@@ -563,7 +563,7 @@
//! use tower_http::services::ServeFile;
//! use http::Response;
//! use std::convert::Infallible;
//! use tower::{service_fn, BoxError};
//! use tower::service_fn;
//!
//! let app = route(
//! // Any request to `/` goes to a service
@@ -715,6 +715,7 @@ use tower::Service;
pub(crate) mod macros;
mod buffer;
mod error;
mod json;
mod util;
@@ -729,14 +730,16 @@ pub mod sse;
#[cfg(test)]
mod tests;
#[doc(no_inline)]
pub use async_trait::async_trait;
#[doc(no_inline)]
pub use http;
#[doc(no_inline)]
pub use hyper::Server;
#[doc(no_inline)]
pub use tower_http::add_extension::{AddExtension, AddExtensionLayer};
pub use crate::json::Json;
pub use self::{error::Error, json::Json};
pub mod prelude {
//! Re-exports of important traits, types, and functions used with axum. Meant to be glob