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;serverpub use tokio;serverpub use jsonrpsee_proc_macros as proc_macros;jsonrpsee-proc-macrospub use tracing;jsonrpsee-proc-macrospub use jsonrpsee_types as types;jsonrpsee-typespub use jsonrpsee_core as core;server-core
Modules§
- helpers
server-core - Helpers.
Structs§
- Batch
Response Builder server-core - Builder for the response to a batch request.
- Bounded
Subscriptions server-core - This wraps [
tokio::sync::Semaphore] and is used to limit the number of subscriptions per connection. - Connection
Id server-core - Connection ID.
- Disconnect
Error server-core - Error that may occur during
crate::server::MethodSink::sendorcrate::server::SubscriptionSink::send. - IsUnsubscribed
server-core - Represents a subscription until it is unsubscribed.
- Method
Response server-core - Represents a response to a method call.
- Method
Sink server-core - Sink that is used to send back the result to the server for a specific method.
- Methods
server-core - Reference-counted, clone-on-write collection of synchronous and asynchronous methods.
- Pending
Subscription Accept Error server-core - The error returned while accepting a subscription.
- Pending
Subscription Sink server-core - Represents a single subscription that is waiting to be accepted or rejected.
- RpcModule
server-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.
RpcModulewraps an additional context argument that can be used to access data during call execution. - Subscription
Key server-core - Represent a unique subscription entry based on [
SubscriptionId] andConnectionId. - Subscription
Message server-core - Subscription message.
- Subscription
Sink server-core - A handle to an active subscription.
- Subscription
State server-core - Helper struct to manage subscriptions.
Enums§
- Method
Callback server-core - Callback wrapper that can be either sync or async.
- Response
Payload server-core - Represent the payload of the JSON-RPC response object
- Send
Timeout Error server-core - Error that may occur during
crate::server::MethodSink::send_timeoutorcrate::server::SubscriptionSink::send_timeout. - Subscription
Close Response server-core - Represents what action that will sent when a subscription callback returns.
- Subscription
Message Inner server-core - A complete subscription message or partial subscription message.
- TrySend
Error server-core - Error that may occur during
crate::server::MethodSink::try_sendorcrate::server::SubscriptionSink::try_send.
Traits§
- Into
Response server-core - Something that can be converted into a JSON-RPC method call response.
- Into
Subscription Close Response server-core - Convert something into a subscription close notification before a subscription is terminated.
Functions§
- prepare_
error server-core - Distinguish malformed JSON from an invalid request and recover its [
Id] when possible.
Type Aliases§
- Async
Method server-core - Similar to
SyncMethod, but represents an asynchronous handler. - MaxResponse
Size server-core - Max response size.
- Subscribers
server-core - Type-alias for subscribers.
- Subscription
Method server-core - Method callback for subscriptions.
- Subscription
Permit server-core - Subscription permit.
- Sync
Method server-core - A
MethodCallbackis an RPC endpoint, callable with a standard JSON-RPC request, implemented as a function pointer to aFnfunction taking four arguments: theid,params, a channel the function uses to communicate the result (or error) back tojsonrpsee, and the connection ID (useful for the websocket transport).