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

Handler for a RPC method.

Required Methods§

source

fn handle(&self, ctx: &mut 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(&mut Context<'_>, &Rq) -> Result<Rsp> + 'static,