Skip to main content

dispatch_request

Function dispatch_request 

Source
pub fn dispatch_request<F, T>(
    service: &ServiceDescriptor,
    opcode: u32,
    handler: F,
) -> RpcResult<T>
Expand description

Dispatcher helper for skeleton implementations.

Reads the opcode from the request discriminator, calls the matching handler closure and returns the encoded reply.

§Errors

OperationNotFound if the opcode is not present in the service.