26 releases

0.10.2 Oct 19, 2018
0.10.0 Sep 24, 2018
0.9.0 Jul 30, 2018
0.8.0 Aug 30, 2016
0.6.2 Nov 23, 2015

#65 in Network programming

Download history 189/week @ 2018-10-17 63/week @ 2018-10-24 187/week @ 2018-10-31 164/week @ 2018-11-07 203/week @ 2018-11-14 181/week @ 2018-11-21 330/week @ 2018-11-28 97/week @ 2018-12-05 236/week @ 2018-12-12 185/week @ 2018-12-19 13/week @ 2018-12-26 75/week @ 2019-01-02 69/week @ 2019-01-09 92/week @ 2019-01-16 78/week @ 2019-01-23

651 downloads per month
Used in 3 crates (2 directly)

CC0 license

21KB
371 lines

Status

Rust JSONRPC Client

Rudimentary support for sending JSONRPC 2.0 requests and receiving responses.

To send a request which should retrieve the above structure, consider the following example code

extern crate jsonrpc;
extern crate serde;
#[macro_use] extern crate serde_derive;

#[derive(Deserialize)]
struct MyStruct {
    elem1: bool,
    elem2: String,
    elem3: Vec<usize>
}

fn main() {
    // The two Nones are for user/pass for authentication
    let mut client = jsonrpc::client::Client::new("example.org".to_owned(), None, None);
    let request = client.build_request("getmystruct".to_owned(), vec![]);
    match client.send_request(&request).and_then(|res| res.into_result::<MyStruct>()) {
        Ok(mystruct) => // Ok!
        Err(e) => // Not so much.
    }
}


lib.rs:

Rust JSON-RPC Library

Rust support for the JSON-RPC 2.0 protocol.

Dependencies

~4.5MB
~95K SLoC