Trait interlink::msg::Handler

source ·
pub trait Handler<M: Message>: Service {
    type Response: ResponseHandler<Self, M>;

    // Required method
    fn handle(
        &mut self,
        msg: M,
        ctx: &mut ServiceContext<Self>
    ) -> Self::Response;
Expand description

Handler implementation for allowing a service to handle a specific message type

Required Associated Types§


type Response: ResponseHandler<Self, M>

The response type this handler will use

Required Methods§


fn handle(&mut self, msg: M, ctx: &mut ServiceContext<Self>) -> Self::Response

Handler for processing the message using the current service context and message. Will respond with the specified response type

self The service handling the message msg The message that is being handled ctx Mutable borrow of the service context