1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Provides an `Error` type which can be used in a `eyre`-like fashion
//! for `axum`
//!
//! ```rust
//! use axum::{response::Html, routing::get, Router};
//! use std::{fs::read_to_string, net::SocketAddr};
//! use axum_error::Result;
//!
//! #[tokio::main]
//! async fn main() {
//! let app = Router::new().route("/", get(index));
//! axum::Server::bind(&SocketAddr::from(([127, 0, 0, 1], 3000)))
//! .serve(app.into_make_service())
//! .await
//! .unwrap()
//! }
//!
//! async fn index() -> Result<Html<String>> {
//! Ok(Html(read_to_string("index.html")?))
//! }
//! ```
use ;
/// Error type which implements `IntoResponse`
;
// Result type
pub type Result<T, E = Error> = Result;