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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
use std::prelude::v1::*;
pub use jsonrpc_core::futures::future::Future;
use jsonrpc_core_client::{transports::ws::connect, RpcError};
use url::Url;
pub fn connect_ws(url: &Url) -> impl Future<Item = ConductorClient, Error = RpcError> {
connect::<ConductorClient>(url)
}
mod rpc_impl_conductor_rpc {
use super::*;
use jsonrpc_core as _jsonrpc_core;
pub mod gen_client {
use super::*;
use _jsonrpc_core::serde_json::{self};
use _jsonrpc_core::{
Params,
};
use _jsonrpc_core_client::{
RpcChannel, RpcError, RawClient,
};
use jsonrpc_core_client as _jsonrpc_core_client;
pub struct Client {
inner: RawClient,
}
#[automatically_derived]
#[allow(unused_qualifications)]
impl ::core::clone::Clone for Client {
#[inline]
fn clone(&self) -> Client {
match *self {
Client {
inner: ref __self_0_0,
} => Client {
inner: ::core::clone::Clone::clone(&(*__self_0_0)),
},
}
}
}
impl Client {
pub fn new(sender: RpcChannel) -> Self {
Client {
inner: sender.into(),
}
}
pub fn call(
&self,
instance_id: String,
zome: String,
function: String,
args: serde_json::Value,
) -> impl Future<Item = serde_json::Value, Error = RpcError> {
let mut map = serde_json::Map::new();
map.insert("instance_id".into(), instance_id.into());
map.insert("zome".into(), zome.into());
map.insert("function".into(), function.into());
map.insert("args".into(), args.into());
let args_map = Params::Map(map);
self.inner.call_method("call", args_map.into())
}
}
impl From<RpcChannel> for Client {
fn from(channel: RpcChannel) -> Self {
Client::new(channel.into())
}
}
}
}
pub use self::rpc_impl_conductor_rpc::gen_client;
pub use gen_client::Client as ConductorClient;