Expand description
Re-exports§
pub use jsonrpsee_types as types;pub use tracing;
Modules§
- helpers
- Helpers.
- http
- HTTP related server functionality.
- middleware
- jsonrpsee-server middleware
- ws
- WebSocket related server functionality.
Structs§
- Already
Stopped Error - Error when the server has already been stopped.
- 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
Guard - Limits the number of connections.
- Connection
Id - Connection ID.
- Connection
State - Connection related state that is needed to execute JSON-RPC calls.
- Disconnect
Error - Error that may occur during
crate::server::MethodSink::sendorcrate::server::SubscriptionSink::send. - Http
Body - Default HTTP body used by jsonrpsee.
- IsUnsubscribed
- Represents a subscription until it is unsubscribed.
- Method
Response - Represents a response to a method call.
- Method
Sink - Sink that is used to send back the result to the server for a specific method.
- 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.
- Random
Integer IdProvider - Generates random integers as subscription ID.
- Random
String IdProvider - Generates random strings of length
lenas subscription ID. - 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. - Server
- JSON RPC server.
- Server
Builder - Builder to configure and create a JSON-RPC server.
- Server
Config - Static server configuration which is shared per connection.
- Server
Config Builder - The builder to configure and create a JSON-RPC server configuration.
- Server
Handle - Server handle.
- Stop
Handle - Represent a stop handle which is a wrapper over a
multi-consumer receiverand cloningStopHandlewill get a separate instance of the underlying receiver. - 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.
- Tower
Service NoHttp - jsonrpsee tower service without HTTP specific middleware.
Enums§
- Batch
Request Config - Configuration for batch request handling.
- Method
Callback - Callback wrapper that can be either sync or async.
- Register
Method Error - The error returned when registering a method or subscription failed.
- 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§
- IdProvider
- Trait to generate subscription IDs.
- 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.
Functions§
- accept_
error_ backoff - Pauses an accept loop after
acceptfailed witherr. - handle_
rpc_ call - Parses
bodyas a single JSON-RPC message (is_single) or a batch, dispatches it torpc_serviceand returns the serialized response. - prepare_
error - Distinguish malformed JSON from an invalid request and recover its [
Id] when possible. - serve_
with_ graceful_ shutdown - Serve a service over a TCP connection with graceful shutdown. This means that pending requests will be completed before the server is stopped.
- stop_
channel - Create channel to determine whether the server shall continue to run or not.
Type Aliases§
- Async
Method - Similar to
SyncMethod, but represents an asynchronous handler. - Connection
Permit - Connection permit.
- Http
Request - HTTP request type.
- Http
Response - HTTP response type.
- 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).