pub fn call_rpc<T, U>(
        &self,
        process_name: &str,
        rpc_name: &str,
        request: T,
        timeout: Duration,
    ) -> Result<U, RpcError>
    where
        T: Debug + DeserializeOwned + Serialize + 'static,
        U: Debug + DeserializeOwned + Serialize + 'static,
    {
        let client: RpcClient<T, U> = match self.get_rpc_from_config(process_name, rpc_name) {
            Some(addr) => RpcClient::with_tcp_addr(addr),
            None => {
                let socket_path = match &self.run_dir {
                    Some(dir) => config::unix_socket_dir(&dir)
                        .as_path()
                        .join(Process::config_name(process_name, rpc_name)),
                    None => {
                        return Err(RpcError::IoError(IoError::new(
                            ErrorKind::Unsupported,
                            format!("Process {} has no run directory", self.name),
                        )))
                    }
                };
                RpcClient::with_unix_socket(&socket_path)
            }
        };
        client.call(request, timeout)
    }
/// Call an RPC.
///
/// This function allows one to make a request to an RPC and get either the result of the call
/// or an error returned. If the RPC endpoint is not listed in the config, it is assumed to be a
/// Unix socket. If the endpoint does not exist, the RPC call will time out. The types for
/// request `T` and response `U` must match waht the RPC server at the endpoint expects or an
/// error may occur.
///
/// Args:
/// * `process_name`: The name of the `Process` instance running the RPC server.
/// * `rpc_name`: The name of the RPC running inside the target `Process`.
/// * `request`: The data to pass into the RPC request.
/// * `timeout`: The expected maximum duration of the RPC call.
///
/// Returns either the result of the RPC call on success or an `RpcError` on failure.
Call an RPC.
This function allows one to make a request to an RPC and get either the result of the call
or an error returned. If the RPC endpoint is not listed in the config, it is assumed to be a
Unix socket. If the endpoint does not exist, the RPC call will time out. The types for
request `T` and response `U` must match waht the RPC server at the endpoint expects or an
error may occur.

`process_name`: The name of the `Process` instance running the RPC server.
`rpc_name`: The name of the RPC running inside the target `Process`.
`request`: The data to pass into the RPC request.
`timeout`: The expected maximum duration of the RPC call.

Returns either the result of the RPC call on success or an `RpcError` on failure.
Call an RPC . This function allows one to make a request to an RPC and get either the result of the call or an error returned . If the RPC endpoint is not listed in the config it is assumed to be a Unix socket . If the endpoint does not exist the RPC call will time out . The types for request ` T ` and response ` U ` must match waht the RPC server at the endpoint expects or an error may occur . ` process_name ` : The name of the ` Process ` instance running the RPC server . ` rpc_name ` : The name of the RPC running inside the target ` Process ` . ` request ` : The data to pass into the RPC request . ` timeout ` : The expected maximum duration of the RPC call . Returns either the result of the RPC call on success or an ` RpcError ` on failure .
pub fn call_rpc<T, U>(
        &self,
        process_name: &str,
        rpc_name: &str,
        request: T,
        timeout: Duration,
    ) -> Result<U, RpcError>
    where
        T: Debug + DeserializeOwned + Serialize + 'static,
        U: Debug + DeserializeOwned + Serialize + 'static,
    {
        let client: RpcClient<T, U> = match self.get_rpc_from_config(process_name, rpc_name) {
            Some(addr) => RpcClient::with_tcp_addr(addr),
            None => {
                let socket_path = match &self.run_dir {
                    Some(dir) => config::unix_socket_dir(&dir)
                        .as_path()
                        .join(Process::config_name(process_name, rpc_name)),
                    None => {
                        return Err(RpcError::IoError(IoError::new(
                            ErrorKind::Unsupported,
                            format!("Process {} has no run directory", self.name),
                        )))
                    }
                };
                RpcClient::with_unix_socket(&socket_path)
            }
        };
        client.call(request, timeout)
    }
pub fn call_rpc < T , U > ( & self , process_name : & str , rpc_name : & str , request : T , timeout : Duration , ) -> Result < U , RpcError > where T : Debug + DeserializeOwned + Serialize + ' static , U : Debug + DeserializeOwned + Serialize + ' static , { let client : RpcClient < T , U > = match self . get_rpc_from_config ( process_name , rpc_name ) { Some ( addr ) => RpcClient :: with_tcp_addr ( addr ) , None => { let socket_path = match & self . run_dir { Some ( dir ) => config :: unix_socket_dir ( & dir ) . as_path ( ) . join ( Process :: config_name ( process_name , rpc_name ) ) , None => { return Err ( RpcError :: IoError ( IoError :: new ( ErrorKind :: Unsupported , format ! ( " " self name ) , ) ) ) } } ; RpcClient :: with_unix_socket ( & socket_path ) } } ; client . call ( request , timeout ) }
Call an RPC.
Call an RPC .
&self
process_name
&str
rpc_name
&str
request
T
timeout
Duration
&self
process_name
&str
rpc_name
&str
request
T
timeout
Duration