basic/
basic.rs

1extern crate rpc_lib;
2extern crate serde;
3#[macro_use]
4extern crate serde_derive;
5extern crate failure;
6
7use failure::Error;
8use rpc_lib::client::prelude::*;
9
10#[derive(Serialize)]
11struct Input {
12    id: String,
13}
14
15#[derive(Deserialize, Debug)]
16struct Project {
17    id: String,
18    url: String,
19    enabled: bool,
20}
21
22fn main() -> Result<(), Error> {
23    let input = Input {
24        id: "x0x0x0x0".to_string(),
25    };
26    let client = Client::new("http://localhost:4000/rpc");
27    let res: Project = client.call("1", "Project.Find", input)?;
28    println!("{:?}", res);
29    Ok(())
30}