-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.rs
27 lines (25 loc) · 879 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use client1_interface::{Client1, Param};
use ffi_rpc::{
abi_stable::prefix_type::PrefixTypeTrait,
async_ffi, async_trait, bincode,
ffi_rpc_macro::{plugin_impl_call, plugin_impl_instance, plugin_impl_root, plugin_impl_trait},
registry::Registry,
};
use server_interface::Server;
#[plugin_impl_instance(|| Api{})]
#[plugin_impl_root]
#[plugin_impl_call(client2_interface::Client2Api)]
struct Api;
#[plugin_impl_trait]
impl client2_interface::Client2Api for Api {
async fn add(&self, r: &Registry, a: i32, b: i32) -> i32 {
let t = Client1::from(r.get("client1").unwrap())
.add(r, &Param { a: 7, b: 8 }, &9)
.await;
let m = Server::from(r.get("server").unwrap()).add(r).await;
let o = Client1::from(r.get("client1").unwrap())
.minus(r, &100, &50)
.await;
a + b + t + m + o
}
}