pub trait ResponseHandler<S: Service, M: Message>: Send + 'static {
// Required method
fn respond(
self,
service: &mut S,
ctx: &mut ServiceContext<S>,
tx: Option<Sender<M::Response>>,
);
}Expand description
Handler implementation for handling what happens with a response value
Required Methods§
fn respond( self, service: &mut S, ctx: &mut ServiceContext<S>, tx: Option<Sender<M::Response>>, )
Implementations on Foreign Types§
Source§impl<S, M> ResponseHandler<S, M> for ()
Void response handler for sending an empty unit
response automatically after executing
impl<S, M> ResponseHandler<S, M> for ()
Void response handler for sending an empty unit response automatically after executing
Source§impl<S, M, R> ResponseHandler<S, M> for Option<R>
Response handler for optional handler types to handle
not sending any response
impl<S, M, R> ResponseHandler<S, M> for Option<R>
Response handler for optional handler types to handle not sending any response
Source§impl<S, M, R, E> ResponseHandler<S, M> for Result<R, E>
Response handler for result response types where the
error half of the result can be handled by a service
error handler
impl<S, M, R, E> ResponseHandler<S, M> for Result<R, E>
Response handler for result response types where the error half of the result can be handled by a service error handler
Implementors§
impl<S, M> ResponseHandler<S, M> for Fr<M>
impl<S, M> ResponseHandler<S, M> for Mr<M>
impl<S, M> ResponseHandler<S, M> for Sfr<S, M>
The response handler for service future responses passes on the producer in an envelope to be handled by the context