Skip to main content

zon_core/
into_service.rs

1use crate::HttpService;
2
3pub trait IntoHttpService<B: Send, X> {
4    type Service: HttpService<B, ResponseBody = Self::ResponseBody>;
5    type ResponseBody;
6    fn into_svc(self) -> Self::Service;
7}
8
9#[doc(hidden)]
10pub enum ImplIntoHttpServiceForServiceTag {}
11
12impl<B, S> IntoHttpService<B, ImplIntoHttpServiceForServiceTag> for S
13where
14    B: Send,
15    S: HttpService<B>,
16{
17    type Service = S;
18    type ResponseBody = <S as HttpService<B>>::ResponseBody;
19
20    fn into_svc(self) -> Self::Service {
21        self
22    }
23}