1 unstable release

0.1.0 May 31, 2024

#992 in Parser implementations

Download history 29/week @ 2024-07-08 98/week @ 2024-07-15 83/week @ 2024-07-22 105/week @ 2024-07-29 99/week @ 2024-08-05 122/week @ 2024-08-12 117/week @ 2024-08-19 194/week @ 2024-08-26 149/week @ 2024-09-02 284/week @ 2024-09-09 315/week @ 2024-09-16 318/week @ 2024-09-23 133/week @ 2024-09-30 161/week @ 2024-10-07 166/week @ 2024-10-14 320/week @ 2024-10-21

813 downloads per month
Used in 19 crates (8 directly)

MIT/Apache

71KB
1.5K SLoC

linera-alloy-json-rpc

Core types for JSON-RPC2.0 clients.

This crate includes data types and traits for JSON-RPC2.0 requests and responses, targeted at RPC client usage.

Core Model

A JSON-RPC2.0 request is a JSON object containing an ID, a method name, and an arbitrary parameters object. The parameters object may be omitted if empty.

Any object that may be Serialized and Cloned may be used as RPC Parameters.

Requests are sent via transports (see linera-alloy-transports). This results in 1 of 3 outcomes, captured in the RpcResult<E> enum:

  • Ok(Response) - The request was successful, and the server returned a response.
  • ErrResp(ErrorPayload) - The request was received by the server. Server-side handling was unsuccessful, and the server returned an error response. This indicates a server-side error.
  • Err(E) - Some client-side error prevented the request from being received by the server, or prevented the response from being processed. This indicates a client-side or transport-related error.

Limitations

  • This library does not support borrowing response data from the deserializer. This is intended to simplify client implementations, but makes the library poorly suited for use in a high-performance server.

Dependencies

~16MB
~359K SLoC