Available on crate feature
server only.Expand description
Shared modules for the JSON-RPC servers.
Re-exports§
pub use helpers::*;
Modules§
- helpers
- Helpers.
Structs§
- Batch
Response Builder - Builder for the response to a batch request.
- Bounded
Subscriptions - This wraps [
tokio::sync::Semaphore] and is used to limit the number of subscriptions per connection. - Connection
Id - Connection ID.
- Disconnect
Error - Error that may occur during
crate::server::MethodSink::sendorcrate::server::SubscriptionSink::send. - IsUnsubscribed
- Represents a subscription until it is unsubscribed.
- Method
Response - Represents a response to a method call.
- Methods
- Reference-counted, clone-on-write collection of synchronous and asynchronous methods.
- Pending
Subscription Accept Error - The error returned while accepting a subscription.
- Pending
Subscription Sink - Represents a single subscription that is waiting to be accepted or rejected.
- RpcModule
- 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 - Represent a unique subscription entry based on [
SubscriptionId] andConnectionId. - Subscription
Message - Subscription message.
- Subscription
Sink - A handle to an active subscription.
- Subscription
State - Helper struct to manage subscriptions.
Enums§
- Method
Callback - Callback wrapper that can be either sync or async.
- Response
Payload - Represent the payload of the JSON-RPC response object
- Send
Timeout Error - Error that may occur during
crate::server::MethodSink::send_timeoutorcrate::server::SubscriptionSink::send_timeout. - Subscription
Close Response - Represents what action that will sent when a subscription callback returns.
- Subscription
Message Inner - A complete subscription message or partial subscription message.
- TrySend
Error - Error that may occur during
crate::server::MethodSink::try_sendorcrate::server::SubscriptionSink::try_send.
Traits§
- Into
Response - Something that can be converted into a JSON-RPC method call response.
- Into
Subscription Close Response - Convert something into a subscription close notification before a subscription is terminated.
Type Aliases§
- Async
Method - Similar to
SyncMethod, but represents an asynchronous handler. - MaxResponse
Size - Max response size.
- Subscribers
- Type-alias for subscribers.
- Subscription
Method - Method callback for subscriptions.
- Subscription
Permit - Subscription permit.
- Sync
Method - 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).