Trait tokio_service::NewService
[−]
[src]
pub trait NewService { type Request; type Response; type Error; type Instance: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>; fn new_service(&self) -> Result<Self::Instance>; }
Creates new Service
values.
Associated Types
type Request
Requests handled by the service
type Response
Responses given by the service
type Error
Errors produced by the service
type Instance: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>
The Service
value created by this factory
Required Methods
fn new_service(&self) -> Result<Self::Instance>
Create and return a new service value.
Implementors
impl<F, R> NewService for F where
F: Fn() -> Result<R>,
R: Service, type Request = R::Request; type Response = R::Response; type Error = R::Error; type Instance = R;impl<S: NewService + ?Sized> NewService for Arc<S> type Request = S::Request; type Response = S::Response; type Error = S::Error; type Instance = S::Instance;
impl<S: NewService + ?Sized> NewService for Rc<S> type Request = S::Request; type Response = S::Response; type Error = S::Error; type Instance = S::Instance;