Crate thin_jsonrpc_client
source ·Expand description
thin-jsonrpc-client
This crate provides a lightweight JSON-RPC compatible client.
Modules
- The backend trait, to connect a client to some server.
- Helpers to build parameters for a JSON-RPC request.
- JSON-RPC response types.
Macros
- Construct positional/array parameters for a JSON-RPC Call.
Structs
- A JSON-RPC client. Build this by calling
Client::from_backend()
and providing a suitable sender and receiver. - This must be polled in order to accept messages from the server. Nothing will happen unless it is. This design allows us to apply backpressure (by polling this less often), and allows us to drive multiple notification streams without requiring any specific async runtime. It will return:
- A JSON-RPC response.
- A struct representing messages from the server. This implements
futures_util::Stream
and provides a couple of additional helper methods to further filter the stream.
Enums
- An error handed back from [
Client::request()
]. - An error returned from trying to deserialize the response.
Type Definitions
- An error was encountered while receiving messages from the backend.