tower_web/middleware/
identity.rs1use super::{Middleware, Chain};
2
3use tower_service::Service;
4
5#[derive(Debug, Default, Clone)]
10pub struct Identity {
11 _p: (),
12}
13
14impl Identity {
15 pub fn new() -> Identity {
17 Identity { _p: () }
18 }
19}
20
21impl<S: Service> Middleware<S> for Identity {
23 type Request = S::Request;
24 type Response = S::Response;
25 type Error = S::Error;
26 type Service = S;
27
28 fn wrap(&self, inner: S) -> Self::Service {
29 inner
30 }
31}
32
33impl<T> ::util::Chain<T> for Identity {
34 type Output = Chain<Self, T>;
35
36 fn chain(self, other: T) -> Self::Output {
37 Chain::new(self, other)
38 }
39}