This is an RPC 2.0 library for making requests to a server, it has been modified to handle some non-standard server responses such as, string error return value.
Because I am supporting some legacy Go RPC server that are slightly off spec, however, this will also support the proper RPC 2.0 spec.
On Linux:
On Windows and macOS:
First, add this to your Cargo.toml
:
toml
[dependencies]
rpc-lib = "1.0.0"
Here is a quite example to get you going: ```rust extern crate rpc_lib; extern crate serde;
extern crate serde_derive;
use rpc_lib::client::prelude::*; use std::error::Error;
struct Input { id: String, }
struct Project { id: String, url: String, enabled: bool, }
fn main() -> Result<(), Box