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
use super::{Middleware, Chain};
use tower_service::Service;
#[derive(Debug, Default, Clone)]
pub struct Identity {
_p: (),
}
impl Identity {
pub fn new() -> Identity {
Identity { _p: () }
}
}
impl<S: Service> Middleware<S> for Identity {
type Request = S::Request;
type Response = S::Response;
type Error = S::Error;
type Service = S;
fn wrap(&self, inner: S) -> Self::Service {
inner
}
}
impl<T> ::util::Chain<T> for Identity {
type Output = Chain<Self, T>;
fn chain(self, other: T) -> Self::Output {
Chain::new(self, other)
}
}