[−][src]Trait tokio_proto::BindServer
Binds a service to an I/O object.
This trait is not intended to be implemented directly; instead, implement one of the server protocol traits:
pipeline::ServerProto
multiplex::ServerProto
streaming::pipeline::ServerProto
streaming::multiplex::ServerProto
See the crate documentation for more details on those traits.
The Kind
parameter, in particular, is a zero-sized type used to allow
blanket implementation from the various protocol traits. Any additional
implementations of this trait should use their own zero-sized kind type to
distinguish them.
Associated Types
type ServiceRequest
[−]
The request type for the service.
type ServiceResponse
[−]
The response type for the service.
type ServiceError
[−]
The error type for the service.
Required methods
fn bind_server<S>(&self, handle: &Handle, io: T, service: S) where
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
[−]
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
Bind the service.
This method should spawn a new task on the given event loop handle which provides the given service on the given I/O object.
Implementors
impl<P, T, B> BindServer<StreamingMultiplex<B>, T> for P where
P: ServerProto<T>,
T: 'static,
B: Stream<Item = P::ResponseBody, Error = P::Error>,
[src][−]
P: ServerProto<T>,
T: 'static,
B: Stream<Item = P::ResponseBody, Error = P::Error>,
type ServiceRequest = Message<P::Request, Body<P::RequestBody, P::Error>>
type ServiceResponse = Message<P::Response, B>
type ServiceError = P::Error
fn bind_server<S>(&self, handle: &Handle, io: T, service: S) where
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
[src]
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
impl<P, T, B> BindServer<StreamingPipeline<B>, T> for P where
P: ServerProto<T>,
T: 'static,
B: Stream<Item = P::ResponseBody, Error = P::Error>,
[src][−]
P: ServerProto<T>,
T: 'static,
B: Stream<Item = P::ResponseBody, Error = P::Error>,
type ServiceRequest = Message<P::Request, Body<P::RequestBody, P::Error>>
type ServiceResponse = Message<P::Response, B>
type ServiceError = P::Error
fn bind_server<S>(&self, handle: &Handle, io: T, service: S) where
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
[src]
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
impl<T: 'static, P: ServerProto<T>> BindServer<Multiplex, T> for P
[src][−]
type ServiceRequest = P::Request
type ServiceResponse = P::Response
type ServiceError = Error
fn bind_server<S>(&self, handle: &Handle, io: T, service: S) where
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
[src]
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError> + 'static,
impl<T: 'static, P: ServerProto<T>> BindServer<Pipeline, T> for P
[src][−]
type ServiceRequest = P::Request
type ServiceResponse = P::Response
type ServiceError = Error
fn bind_server<S>(&self, handle: &Handle, io: T, service: S) where
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Error> + 'static,
[src]
S: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Error> + 'static,