pub fn connect<T>(url: &str) -> Result<impl Future<Item = T, Error = RpcError>, Error>
where
	T: From<RpcChannel>,
{
	let client = ClientBuilder::new(url)?
		.async_connect(None)
		.map(|(client, _)| {
			let (sink, stream) = client.split();
			let (sink, stream) = WebsocketClient::new(sink, stream).split();
			let (rpc_client, sender) = super::duplex(sink, stream);
			let rpc_client = rpc_client.map_err(|error| eprintln!("{:?}", error));
			tokio::spawn(rpc_client);
			sender.into()
		})
		.map_err(|error| RpcError::Other(error.into()));
	Ok(client)
}
/// Connect to a JSON-RPC websocket server.
///
/// Uses an unbuffered channel to queue outgoing rpc messages.
Connect to a JSON-RPC websocket server.
Uses an unbuffered channel to queue outgoing rpc messages.
Connect to a JSON - RPC websocket server . Uses an unbuffered channel to queue outgoing rpc messages .
pub fn connect<T>(url: &str) -> Result<impl Future<Item = T, Error = RpcError>, Error>
where
	T: From<RpcChannel>,
{
	let client = ClientBuilder::new(url)?
		.async_connect(None)
		.map(|(client, _)| {
			let (sink, stream) = client.split();
			let (sink, stream) = WebsocketClient::new(sink, stream).split();
			let (rpc_client, sender) = super::duplex(sink, stream);
			let rpc_client = rpc_client.map_err(|error| eprintln!("{:?}", error));
			tokio::spawn(rpc_client);
			sender.into()
		})
		.map_err(|error| RpcError::Other(error.into()));
	Ok(client)
}
pub fn connect < T > ( url : & str ) -> Result < impl Future < Item = T , Error = RpcError > , Error > where T : From < RpcChannel > , { let client = ClientBuilder :: new ( url ) ? . async_connect ( None ) . map ( | ( client , _ ) | { let ( sink , stream ) = client . split ( ) ; let ( sink , stream ) = WebsocketClient :: new ( sink , stream ) . split ( ) ; let ( rpc_client , sender ) = super :: duplex ( sink , stream ) ; let rpc_client = rpc_client . map_err ( | error | eprintln ! ( " " error ) ) ; tokio :: spawn ( rpc_client ) ; sender . into ( ) } ) . map_err ( | error | RpcError :: Other ( error . into ( ) ) ) ; Ok ( client ) }
Connect to a JSON-RPC websocket server.
Connect to a JSON - RPC websocket server .
url
&str