use http::{Request, Response};
use http_body::Body;
use tower_service::Service;
use private::Sealed;
#[cfg_attr(not(feature = "hyper"), allow(intra_doc_link_resolution_failure))]
pub trait HttpService<B>: Service<Request<B>> + Sealed<B> {
type ResponseBody: Body;
}
impl<S, ReqB, ResB> HttpService<ReqB> for S
where
S: Service<Request<ReqB>, Response = Response<ResB>> + ?Sized,
ResB: Body,
{
type ResponseBody = ResB;
}
mod private {
use http::{Request, Response};
use http_body::Body;
use tower_service::Service;
pub trait Sealed<B> {}
impl<S, ReqB, ResB> Sealed<ReqB> for S
where
S: Service<Request<ReqB>, Response = Response<ResB>> + ?Sized,
ResB: Body,
{
}
}