Crate jsonrpsee

source ·
Expand description

jsonrpsee wrapper crate.


§Optional features

The jsonrpsee crate composes JSON-RPC functionality behind optional feature flags to provide for client and server communication over specific protocols. There are no default features, all functionality must be opted in to accordingly. The following features are available.

  • http-client - JSON-RPC client functionality over HTTP protocol.
  • wasm-client - JSON-RPC client functionality over web-sys.
  • ws-client - JSON-RPC client functionality over WebSocket protocol.
  • macros - JSON-RPC API generation convenience by derive macros.
  • client-core - Enables minimal client features to generate the RPC API without transports.
  • client - Enables all client features including transports.
  • server-core - Enables minimal server features to generate the RPC API without transports.
  • server - Enables all server features including transports.
  • full - Enables all features.
  • async-client - Enables the async client without any transport.
  • client-ws-transport - Enables ws transport with TLS.
  • client-ws-transport-no-tls - Enables ws transport without TLS.
  • client-web-transport - Enables websys transport.

Re-exports§

Modules§

Macros§

Structs§

Enums§

Traits§

  • IntoResponseserver-core
    Something that can be converted into a JSON-RPC method call response.
  • Convert something into a subscription close notification before a subscription is terminated.

Functions§

  • Create a JSON-RPC error response.
  • prepare_errorserver-core
    Figure out if this is a sufficiently complete request that we can extract an Id out of, or just plain unparseable garbage.

Type Aliases§

  • AsyncMethodserver-core
    Similar to SyncMethod, but represents an asynchronous handler.
  • MaxResponseSizeserver-core
    Max response size.
  • RawRpcResponseserver-core
    Raw response from an RPC A tuple containing:
  • Subscribersserver-core
    Type-alias for subscribers.
  • Method callback for subscriptions.
  • Subscription permit.
  • SyncMethodserver-core
    A MethodCallback is an RPC endpoint, callable with a standard JSON-RPC request, implemented as a function pointer to a Fn function taking four arguments: the id, params, a channel the function uses to communicate the result (or error) back to jsonrpsee, and the connection ID (useful for the websocket transport).