docs.rs failed to build tarpc-0.5.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
tarpc-0.34.0
An RPC library for Rust.
Example usage:
#[macro_use] extern crate tarpc;
mod my_server {
service! {
rpc hello(name: String) -> String;
rpc add(x: i32, y: i32) -> i32;
}
}
use self::my_server::*;
use std::time::Duration;
struct Server;
impl my_server::Service for Server {
fn hello(&self, s: String) -> String {
format!("Hello, {}!", s)
}
fn add(&self, x: i32, y: i32) -> i32 {
x + y
}
}
fn main() {
let serve_handle = Server.spawn("localhost:0").unwrap();
let client = Client::new(serve_handle.dialer()).unwrap();
assert_eq!(3, client.add(1, 2).unwrap());
assert_eq!("Hello, Mom!".to_string(),
client.hello("Mom".to_string()).unwrap());
drop(client);
serve_handle.shutdown();
}