mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-16 00:00:18 +02:00
Add error handling and dependency injection example (#23)
This commit is contained in:
@@ -188,6 +188,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<T> for Html<T> {
|
||||
fn from(inner: T) -> Self {
|
||||
Self(inner)
|
||||
}
|
||||
}
|
||||
|
||||
/// A JSON response.
|
||||
///
|
||||
/// Can be created from any type that implements [`serde::Serialize`].
|
||||
@@ -238,3 +244,9 @@ where
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<T> for Json<T> {
|
||||
fn from(inner: T) -> Self {
|
||||
Self(inner)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user