pub trait BindClient<Kind, T: 'static>: 'static {
type ServiceRequest;
type ServiceResponse;
type ServiceError;
type BindClient: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError>;
// Required method
fn bind_client(&self, handle: &Handle, io: T) -> Self::BindClient;
}
Expand description
Binds an I/O object as a client of a service.
This trait is not intended to be implemented directly; instead, implement one of the server protocol traits:
pipeline::ClientProto
multiplex::ClientProto
streaming::pipeline::ClientProto
streaming::multiplex::ClientProto
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.
Required Associated Types§
Sourcetype ServiceRequest
type ServiceRequest
The request type for the service.
Sourcetype ServiceResponse
type ServiceResponse
The response type for the service.
Sourcetype ServiceError
type ServiceError
The error type for the service.
Sourcetype BindClient: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError>
type BindClient: Service<Request = Self::ServiceRequest, Response = Self::ServiceResponse, Error = Self::ServiceError>
The bound service.
Required Methods§
Sourcefn bind_client(&self, handle: &Handle, io: T) -> Self::BindClient
fn bind_client(&self, handle: &Handle, io: T) -> Self::BindClient
Bind an I/O object as a service.