diff --git a/examples/channel_service.rs b/examples/channel_service.rs index 2606f88..edfb1cf 100644 --- a/examples/channel_service.rs +++ b/examples/channel_service.rs @@ -82,8 +82,8 @@ impl NewService for NewChannelService { type Response = String; type Error = Error; type InitError = io::Error; - type Instance = ChannelService; - type Future = FutureResult; + type Service = ChannelService; + type Future = FutureResult; fn new_service(&self) -> Self::Future { let (tx, rx) = mpsc::channel::<(String, oneshot::Sender)>(self.buffer); diff --git a/src/lib.rs b/src/lib.rs index 050b211..c8a5a18 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -214,13 +214,13 @@ pub trait NewService { type Error; /// The `Service` value created by this factory - type Instance: Service; + type Service: Service; /// Errors produced while building a service. type InitError; /// The future of the `Service` instance. - type Future: Future; + type Future: Future; /// Create and return a new service value asynchronously. fn new_service(&self) -> Self::Future; @@ -252,7 +252,7 @@ impl NewService for F type Request = S::Request; type Response = S::Response; type Error = S::Error; - type Instance = S; + type Service = S; type InitError = E; type Future = R::Future; @@ -265,7 +265,7 @@ impl NewService for Arc { type Request = S::Request; type Response = S::Response; type Error = S::Error; - type Instance = S::Instance; + type Service = S::Service; type InitError = S::InitError; type Future = S::Future; @@ -278,7 +278,7 @@ impl NewService for Rc { type Request = S::Request; type Response = S::Response; type Error = S::Error; - type Instance = S::Instance; + type Service = S::Service; type InitError = S::InitError; type Future = S::Future;