linera-alloy-json-rpc

Crates.iolinera-alloy-json-rpc
lib.rslinera-alloy-json-rpc
version0.1.0
sourcesrc
created_at2024-05-31 18:43:04.217747
updated_at2024-05-31 18:43:04.217747
descriptionCore types for JSON-RPC2.0 clients
homepagehttps://github.com/MathieuDutSik/alloy
repositoryhttps://github.com/MathieuDutSik/alloy
max_upload_size
id1258205
size70,057
Mathieu Baudet (ma2bd)

documentation

README

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.
Commit count: 621

cargo fmt