Skip to main content

Crate jsonrpsee

Crate jsonrpsee 

Source
Expand description

jsonrpsee wrapper crate.


§Optional features

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

  • macros - JSON-RPC API generation convenience by derive macros.
  • server-core - Enables minimal server features to generate the RPC API without transports.
  • server - Enables all server features including transports.
  • full - Enables all features.

Vendored from jsonrpsee, Copyright (c) 2019-2021 Parity Technologies (UK) Ltd., licensed under the MIT License (see crates/rpc/jsonrpsee/LICENSE).

Re-exports§

pub use jsonrpsee_server as server;server
pub use tokio;server
pub use jsonrpsee_proc_macros as proc_macros;jsonrpsee-proc-macros
pub use tracing;jsonrpsee-proc-macros
pub use jsonrpsee_types as types;jsonrpsee-types
pub use jsonrpsee_core as core;server-core

Modules§

helpersserver-core
Helpers.

Structs§

BatchResponseBuilderserver-core
Builder for the response to a batch request.
BoundedSubscriptionsserver-core
This wraps [tokio::sync::Semaphore] and is used to limit the number of subscriptions per connection.
ConnectionIdserver-core
Connection ID.
DisconnectErrorserver-core
Error that may occur during crate::server::MethodSink::send or crate::server::SubscriptionSink::send.
IsUnsubscribedserver-core
Represents a subscription until it is unsubscribed.
MethodResponseserver-core
Represents a response to a method call.
MethodSinkserver-core
Sink that is used to send back the result to the server for a specific method.
Methodsserver-core
Reference-counted, clone-on-write collection of synchronous and asynchronous methods.
PendingSubscriptionAcceptErrorserver-core
The error returned while accepting a subscription.
PendingSubscriptionSinkserver-core
Represents a single subscription that is waiting to be accepted or rejected.
RpcModuleserver-core
Sets of JSON-RPC methods can be organized into “module“s that are in turn registered on the server or, alternatively, merged with other modules to construct a cohesive API. RpcModule wraps an additional context argument that can be used to access data during call execution.
SubscriptionKeyserver-core
Represent a unique subscription entry based on [SubscriptionId] and ConnectionId.
SubscriptionMessageserver-core
Subscription message.
SubscriptionSinkserver-core
A handle to an active subscription.
SubscriptionStateserver-core
Helper struct to manage subscriptions.

Enums§

MethodCallbackserver-core
Callback wrapper that can be either sync or async.
ResponsePayloadserver-core
Represent the payload of the JSON-RPC response object
SendTimeoutErrorserver-core
Error that may occur during crate::server::MethodSink::send_timeout or crate::server::SubscriptionSink::send_timeout.
SubscriptionCloseResponseserver-core
Represents what action that will sent when a subscription callback returns.
SubscriptionMessageInnerserver-core
A complete subscription message or partial subscription message.
TrySendErrorserver-core
Error that may occur during crate::server::MethodSink::try_send or crate::server::SubscriptionSink::try_send.

Traits§

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

Functions§

prepare_errorserver-core
Distinguish malformed JSON from an invalid request and recover its [Id] when possible.

Type Aliases§

AsyncMethodserver-core
Similar to SyncMethod, but represents an asynchronous handler.
MaxResponseSizeserver-core
Max response size.
Subscribersserver-core
Type-alias for subscribers.
SubscriptionMethodserver-core
Method callback for subscriptions.
SubscriptionPermitserver-core
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).