Build Status

Easy JSON RPC

Generate a jsonrpc handler from a trait definition.

```rust use easy_jsonrpc::{self, JSONRPCServer};

[easyjsonrpc::jsonrpcserver]

pub trait Adder { fn checked_add(&self, a: isize, b: isize) -> Option; }

struct AdderImpl;

impl Adder for AdderImpl { fn checkedadd(&self, a: isize, b: isize) -> Option { a.checkedadd(b) } }

fn main() { let adder = (&AdderImpl {} as &dyn Adder);

assert_eq!(
    adder.handle_raw(
        r#"{"jsonrpc": "2.0", "method": "wrapping_add", "params": [1, 2], "id": 1}"#
    ).unwrap(),
    r#"{"jsonrpc":"2.0","result":3,"id":1}"#.into()
);

} ```

Client generator not yet implemented.