[][src]Crate tendermint_rpc

Tendermint RPC definitions and types.

Client

This crate optionally provides access to different types of RPC client functionality and different client transports based on which features you select when using it.

Two features are provided at present:

  • http-client - Provides HttpClient, which is a basic RPC client that interacts with remote Tendermint nodes via JSON-RPC over HTTP. This client does not provide Event subscription functionality. See the Tendermint RPC for more details.
  • websocket-client - Provides WebSocketClient, which currently only provides Event subscription functionality over a WebSocket connection. See the /subscribe endpoint in the Tendermint RPC for more details. This client does not yet provide access to the RPC methods provided by the Client trait (this is planned for a future release).

Mock Clients

Mock clients are included when either of the http-client or websocket-client features are enabled to aid in testing. This includes MockClient, which only implements Client (no subscription functionality), and MockSubscriptionClient, which helps you simulate subscriptions to events being generated by a Tendermint node.

Re-exports

pub use self::error::Error;
pub use self::request::Request;
pub use self::response::Response;

Modules

endpoint

Tendermint JSON-RPC endpoints

error

JSON-RPC error types

event

RPC subscription event-related data structures.

query

Structured querying for the Tendermint RPC event subscription system.

request

JSON-RPC requests

response

JSON-RPC response types

Structs

HttpClient

A JSON-RPC/HTTP Tendermint RPC client (implements Client).

MockClient

A mock client implementation for use in testing.

MockRequestMethodMatcher

Provides a simple MockRequestMatcher implementation that simply maps requests with specific methods to responses.

MockSubscriptionClient

A mock client that facilitates Event subscription.

Subscription

An interface that can be used to asynchronously receive Events for a particular subscription.

SubscriptionId

Each new subscription is automatically assigned an ID.

Version

JSON-RPC version

WebSocketClient

Tendermint RPC client that provides Event subscription capabilities over JSON-RPC over a WebSocket connection.

WebSocketClientDriver

Drives the WebSocket connection for a WebSocketClient instance.

Enums

Id

JSON-RPC ID: request-specific identifier

Method

JSON-RPC request methods.

Traits

Client

Provides lightweight access to the Tendermint RPC. It gives access to all endpoints with the exception of the event subscription-related ones.

MockRequestMatcher

A trait required by the MockClient that allows for different approaches to mocking responses for specific requests.

SubscriptionClient

A client that exclusively provides Event subscription capabilities, without any other RPC method support.

Type Definitions

Result

RPC client-related result type alias.