#jsonrpc #codec #jsonrpc-parse #jsonrpc-codec

jsonrpc-parse

parse JSON-RPC (2.0) from TCP Bytes or deparse JSON-RPC to Codec and Bytes

3 releases

✓ Uses Rust 2018 edition

0.1.2 May 22, 2019
0.1.1 May 21, 2019
0.1.0 Mar 21, 2019

#9 in #codec

30 downloads per month
Used in 1 crate

MIT license

19KB
473 lines

jsonrpc-parse

parse JSON-RPC (2.0) from TCP Bytes or deparse JSON-RPC to Codec and Bytes

[dependencies]
jsonrpc_parse = "0.1"
use jsonrpc_parse::httpcodec::{HTTPCodec, HTTP};

// use HTTPCodec to parse frame bytes, the result is HTTPCodec's HTTP

match http {
    HTTP::Request(req) => {}
    HTTP::Response(resp) => {}
    _ => {} // other is Response about the Error, can return direct.
}

Dependencies

~3MB
~60K SLoC