15 stable releases (5 major)

✓ Uses Rust 2018 edition

14.0.5 Nov 28, 2019
13.2.0 Sep 13, 2019
13.0.0 Jul 29, 2019
12.2.0 Jul 30, 2019
0.1.0 Nov 5, 2018
Download history 552/week @ 2019-11-07 645/week @ 2019-11-14 305/week @ 2019-11-21 392/week @ 2019-11-28 1145/week @ 2019-12-05 851/week @ 2019-12-12 391/week @ 2019-12-19 208/week @ 2019-12-26 885/week @ 2020-01-02 1856/week @ 2020-01-09 1349/week @ 2020-01-16 19/week @ 2020-01-23 10/week @ 2020-01-30 11/week @ 2020-02-06 22/week @ 2020-02-13

2,159 downloads per month

MIT license

68KB
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

~3MB
~64K SLoC