http_error/
reason.rs

1use std::fmt;
2
3use crate::HttpError;
4
5pub struct Reason<E>(pub E);
6
7impl<E> fmt::Display for Reason<E>
8where
9    E: HttpError,
10{
11    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12        self.0.reason(f)
13    }
14}
15
16impl fmt::Display for Reason<Box<dyn HttpError>> {
17    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18        self.0.reason(f)
19    }
20}
21
22impl fmt::Display for Reason<Box<dyn HttpError + Send + 'static>> {
23    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
24        self.0.reason(f)
25    }
26}