#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
pub use jsonrpc_core::futures::future::Future;
use jsonrpc_core_client::{transports::ws::connect, RpcError};
use jsonrpc_derive::rpc;
use url::Url;
pub fn connect_ws(url: &Url) -> impl Future<Item = ConductorClient, Error = RpcError> {
connect::<ConductorClient>(url)
}
mod rpc_impl_ConductorRpc {
use super::*;
use jsonrpc_core as _jsonrpc_core;
pub mod gen_client {
use super::*;
use _jsonrpc_core::futures::prelude::*;
use _jsonrpc_core::futures::sync::{mpsc, oneshot};
use _jsonrpc_core::serde_json::{self, Value};
use _jsonrpc_core::{
Call, Error, ErrorCode, Id, MethodCall, Params, Request, Response, Version,
};
use _jsonrpc_core_client::{
RpcChannel, RpcError, RpcFuture, TypedClient, TypedSubscriptionStream,
};
use jsonrpc_core_client as _jsonrpc_core_client;
pub struct Client {
inner: TypedClient,
}
#[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 = String, Error = RpcError> {
let args_tuple = (instance_id, zome, function, args);
self.inner.call_method("call", "String", args_tuple)
}
}
impl From<RpcChannel> for Client {
fn from(channel: RpcChannel) -> Self {
Client::new(channel.into())
}
}
}
}
pub use self::rpc_impl_ConductorRpc::gen_client;
pub use gen_client::Client as ConductorClient;