pub trait MakeServiceRef<Target, ReqBody>: Sealed<(Target, ReqBody)> {
type ResBody: HttpBody;
type Error: Into<Box<dyn Error + Send + Sync>>;
type Service: HttpService<ReqBody, ResBody = Self::ResBody, Error = Self::Error>;
type MakeError: Into<Box<dyn Error + Send + Sync>>;
type Future: Future<Output = Result<Self::Service, Self::MakeError>>;
// Required methods
fn poll_ready_ref(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::MakeError>>;
fn make_service_ref(&mut self, target: &Target) -> Self::Future;
}
Expand description
A trait for types that can be used to make HTTP services, by recieving references to connections.
Required Associated Types§
Sourcetype Error: Into<Box<dyn Error + Send + Sync>>
type Error: Into<Box<dyn Error + Send + Sync>>
The error type that can occur within this Service
.
Sourcetype Service: HttpService<ReqBody, ResBody = Self::ResBody, Error = Self::Error>
type Service: HttpService<ReqBody, ResBody = Self::ResBody, Error = Self::Error>
The Service type produced to handle requests.
Required Methods§
Sourcefn poll_ready_ref(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::MakeError>>
fn poll_ready_ref( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::MakeError>>
Poll the readiness of the make_serivce.
Sourcefn make_service_ref(&mut self, target: &Target) -> Self::Future
fn make_service_ref(&mut self, target: &Target) -> Self::Future
Create a new service.