hyperlane-plugin-rpc 22.12.0

A JSON-RPC 2.0 server plugin for the Hyperlane framework with async method routing, batch dispatch, notification handling, and configurable payload and batch DoS bounds.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::*;

/// Boxed `Send` future returned by an async JSON-RPC 2.0 method handler.
pub type RpcFuture = Pin<Box<dyn Future<Output = Result<Value, RpcError>> + Send>>;

/// Thread-safe async JSON-RPC 2.0 method handler callback.
pub type RpcHandler = Arc<dyn Fn(Option<Value>) -> RpcFuture + Send + Sync>;

/// Thread-safe shared reference to a custom [`RpcInterceptor`].
pub type SharedRpcInterceptor = Arc<dyn RpcInterceptor>;

/// Pre-validated JSON-RPC call ready for async execution or immediate short-circuit reply.
pub(crate) type PreparedRpcCall =
    Result<(RpcHandler, Option<Value>, Option<RpcId>), Option<Box<RpcResponse>>>;