Registry / networking / susydev-jsonrpc-core

susydev-jsonrpc-core

JSON →
library11.0.0rscratesunverified

Transport agnostic rust implementation of JSON-RPC 2.0 Specification.

# Cargo.toml [dependencies] susydev-jsonrpc-core = "11.0.0"
INSTALL
IMPORT
SIG · SUSYDEV-JSONRPC-CO
S
susydev-jsonrpc-core
networkingrustv11.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IoHandler
use susydev_jsonrpc_core::IoHandler;

Creates an IoHandler, registers a method, and handles a JSON-RPC request.

use susydev_jsonrpc_core::IoHandler; let mut io = IoHandler::new(); io.add_method("say_hello", |_| { Ok(Value::String("hello".to_string())) }); let request = r#"{"jsonrpc":"2.0","method":"say_hello","id":1}"#; let response = io.handle_request(request).await.unwrap();
Debug
Known issues
gotchaRequires an async runtime for `handle_request`.
fix
Use `#[tokio::main]` or similar async runtime.
affects: >=11.0.0
Upgrade
Version history
11.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
34
Resources
susydev-jsonrpc-core — cargo add susydev-jsonrpc-core · libregistry