Trait json_rpc2::Service[][src]

pub trait Service {
    fn handle(&self, req: &mut Request) -> Result<Option<Response>>;
}

Trait for service handlers that maybe handle a request.

Required methods

fn handle(&self, req: &mut Request) -> Result<Option<Response>>[src]

Service implementations are invoked with a request and should reply with a response if the method name is one handled by the service.

If the method name for the request is not handled by the service if should return None so that the broker tries subsequent services.

Loading content...

Implementors

Loading content...