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.