Skip to main content

handle_rpc_call

Function handle_rpc_call 

Source
pub async fn handle_rpc_call<S>(
    body: &[u8],
    is_single: bool,
    batch_config: BatchRequestConfig,
    rpc_service: &S,
) -> MethodResponse
where S: RpcServiceT + Send,
Expand description

Parses body as a single JSON-RPC message (is_single) or a batch, dispatches it to rpc_service and returns the serialized response.

A panicking call is answered with an internal error. The caller sends the response only if it is a method call or a batch: notifications are not answered and subscription calls answer through the subscription sink.