11 stable releases (5 major)

✓ Uses Rust 2018 edition

new 14.0.0 Oct 9, 2019
13.2.0 Sep 13, 2019
13.1.0 Aug 26, 2019
13.0.0 Jul 29, 2019
0.1.0 Nov 5, 2018
Download history 51/week @ 2019-06-26 41/week @ 2019-07-03 23/week @ 2019-07-10 9/week @ 2019-07-17 17/week @ 2019-07-24 33/week @ 2019-07-31 281/week @ 2019-08-07 1658/week @ 2019-08-14 2152/week @ 2019-08-21 355/week @ 2019-08-28 227/week @ 2019-09-04 240/week @ 2019-09-11 525/week @ 2019-09-18 496/week @ 2019-09-25 199/week @ 2019-10-02

2,075 downloads per month

MIT license

67KB
1.5K SLoC

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 = "14.0"

main.rs

use jsonrpc_stdio_server::server;
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();
}

lib.rs:

jsonrpc server using stdin/stdout


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();
}

Dependencies

~2–2.6MB
~53K SLoC