Trait tsukuyomi_service::MakeService
source · pub trait MakeService<Ctx, Request> {
type Response;
type Error;
type Service: Service<Request, Response = Self::Response, Error = Self::Error>;
type MakeError;
type Future: Future<Item = Self::Service, Error = Self::MakeError>;
fn make_service(&self, ctx: Ctx) -> Self::Future;
}
Expand description
A trait representing a factory of Service
s.
The signature of this trait imitates tower_util::MakeService
,
but there are the following differences:
- This trait does not have the method
poll_ready
to check if the factory is ready for creating aService
. - The method
make_service
is immutable.
Required Associated Types§
Required Methods§
sourcefn make_service(&self, ctx: Ctx) -> Self::Future
fn make_service(&self, ctx: Ctx) -> Self::Future
Creates a Future
that will return a value of Service
.