composable_tower_http/
error.rs

1use std::convert::Infallible;
2
3#[derive(Debug, Clone, thiserror::Error)]
4#[error("Infallible")]
5#[repr(transparent)]
6pub struct InfallibleError(Infallible);
7
8#[cfg(feature = "axum")]
9mod axum {
10    use axum::response::{IntoResponse, Response};
11
12    use super::InfallibleError;
13
14    impl IntoResponse for InfallibleError {
15        fn into_response(self) -> Response {
16            ().into_response()
17        }
18    }
19
20    impl From<InfallibleError> for Response {
21        fn from(value: InfallibleError) -> Self {
22            value.into_response()
23        }
24    }
25}