jsonrpc-stdio-server

Crates.iojsonrpc-stdio-server
lib.rsjsonrpc-stdio-server
version18.0.0
sourcesrc
created_at2018-11-05 12:05:23.629091
updated_at2021-07-20 15:58:21.758738
descriptionSTDIN/STDOUT server for JSON-RPC
homepagehttps://github.com/paritytech/jsonrpc
repositoryhttps://github.com/paritytech/jsonrpc
max_upload_size
id94826
size16,734
Core devs (github:paritytech:core-devs)

documentation

https://docs.rs/jsonrpc-stdio-server/

README

jsonrpc-stdio-server

STDIN/STDOUT server for JSON-RPC 2.0. Takes one request per line and outputs each response on a new line.

Documentation

Example

Cargo.toml

[dependencies]
jsonrpc-stdio-server = "15.0"

main.rs

use jsonrpc_stdio_server::ServerBuilder;
use jsonrpc_stdio_server::jsonrpc_core::*;

fn main() {
	let mut io = IoHandler::default();
	io.add_method("say_hello", |_params| {
		Ok(Value::String("hello".to_owned()))
	});

	ServerBuilder::new(io).build();
}
Commit count: 771

cargo fmt