tokio_service

Trait NewService

Source
pub trait NewService {
    type Request;
    type Response;
    type Error;
    type Instance: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>;

    // Required method
    fn new_service(&self) -> Result<Self::Instance>;
}
Expand description

Creates new Service values.

Required Associated Types§

Source

type Request

Requests handled by the service

Source

type Response

Responses given by the service

Source

type Error

Errors produced by the service

Source

type Instance: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>

The Service value created by this factory

Required Methods§

Source

fn new_service(&self) -> Result<Self::Instance>

Create and return a new service value.

Implementations on Foreign Types§

Source§

impl<S: NewService + ?Sized> NewService for Rc<S>

Source§

impl<S: NewService + ?Sized> NewService for Arc<S>

Implementors§

Source§

impl<F, R> NewService for F
where F: Fn() -> Result<R>, R: Service,