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)
}
}