Registry / networking / jsonrpc-core

jsonrpc-core

JSON →
library18.0.0rscratesunverified

Transport agnostic Rust implementation of JSON-RPC 2.0 Specification.

# Cargo.toml [dependencies] jsonrpc-core = "18.0.0"
INSTALL
IMPORT
SIG · JSONRPC-CORE
J
jsonrpc-core
networkingrustv18.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 jsonrpc_core::IoHandler;

Sets up a JSON-RPC handler and processes a request.

use jsonrpc_core::{IoHandler, Params, Value}; fn main() { let mut io = IoHandler::new(); io.add_method("say_hello", |_params: Params| { Ok(Value::String("Hello!".to_string())) }); let request = r#"{"jsonrpc":"2.0","method":"say_hello","id":1}"#; let response = io.handle_request(request).unwrap(); println!("{}", response); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
18.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

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