/// Create a new RpcClient using the given framed substream and perform the RPC handshake.
Create a new RpcClient using the given framed substream and perform the RPC handshake.
Create a new RpcClient using the given framed substream and perform the RPC handshake .
pub async fn connect<TSubstream>(
        config: RpcClientConfig,
        framed: CanonicalFraming<TSubstream>,
    ) -> Result<Self, RpcError>
    where
        TSubstream: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    {
        let (request_tx, request_rx) = mpsc::channel(1);
        let connector = ClientConnector { inner: request_tx };
        let (ready_tx, ready_rx) = oneshot::channel();
        task::spawn(RpcClientWorker::new(config, request_rx, framed, ready_tx).run());
        ready_rx
            .await
            .expect("ready_rx oneshot is never dropped without a reply")?;
        Ok(Self { connector })
    }
pub async fn connect < TSubstream > ( config : RpcClientConfig , framed : CanonicalFraming < TSubstream > , ) -> Result < Self , RpcError > where TSubstream : AsyncRead + AsyncWrite + Unpin + Send + ' static , { let ( request_tx , request_rx ) = mpsc :: channel ( 1 ) ; let connector = ClientConnector { inner : request_tx } ; let ( ready_tx , ready_rx ) = oneshot :: channel ( ) ; task :: spawn ( RpcClientWorker :: new ( config , request_rx , framed , ready_tx ) . run ( ) ) ; ready_rx . await . expect ( " " ) ? ; Ok ( Self { connector } ) }
Create a new RpcClient using the given framed substream and perform the RPC handshake.
Create a new RpcClient using the given framed substream and perform the RPC handshake .
config
RpcClientConfig
framed
CanonicalFraming<TSubstream>