pub trait MethodHandler<Rq, Rsp> {
    // Required method
    fn handle(&self, ctx: &Context, request: &Rq) -> Result<Rsp>;
}
Expand description

Handler for a RPC method.

Required Methods§

source

fn handle(&self, ctx: &Context, request: &Rq) -> Result<Rsp>

Invoke the method implementation and return a response.

Implementors§

source§

impl<Rq, Rsp, F> MethodHandler<Rq, Rsp> for F
where Rq: 'static, Rsp: 'static, F: Fn(&Context, &Rq) -> Result<Rsp> + 'static,