pub async fn send_rpc(
        &mut self,
        recipient: PeerId,
        protocol: ProtocolId,
        req_msg: TMessage,
        timeout: Duration,
    ) -> Result<TMessage, RpcError> {
        // serialize request
        let req_data = lcs::to_bytes(&req_msg)?.into();
        let res_data = self
            .peer_mgr_reqs_tx
            .send_rpc(recipient, protocol, req_data, timeout)
            .await?;
        let res_msg: TMessage = lcs::from_bytes(&res_data)?;
        Ok(res_msg)
    }
/// Send a protobuf rpc request to a single recipient while handling
/// serialization and deserialization of the request and response respectively.
/// Assumes that the request and response both have the same message type.
Send a protobuf rpc request to a single recipient while handling
serialization and deserialization of the request and response respectively.
Assumes that the request and response both have the same message type.
Send a protobuf rpc request to a single recipient while handling serialization and deserialization of the request and response respectively . Assumes that the request and response both have the same message type .
pub async fn send_rpc(
        &mut self,
        recipient: PeerId,
        protocol: ProtocolId,
        req_msg: TMessage,
        timeout: Duration,
    ) -> Result<TMessage, RpcError> {
        // serialize request
        let req_data = lcs::to_bytes(&req_msg)?.into();
        let res_data = self
            .peer_mgr_reqs_tx
            .send_rpc(recipient, protocol, req_data, timeout)
            .await?;
        let res_msg: TMessage = lcs::from_bytes(&res_data)?;
        Ok(res_msg)
    }
pub async fn send_rpc ( & mut self , recipient : PeerId , protocol : ProtocolId , req_msg : TMessage , timeout : Duration , ) -> Result < TMessage , RpcError > { // serialize request let req_data = lcs :: to_bytes ( & req_msg ) ? . into ( ) ; let res_data = self . peer_mgr_reqs_tx . send_rpc ( recipient , protocol , req_data , timeout ) . await ? ; let res_msg : TMessage = lcs :: from_bytes ( & res_data ) ? ; Ok ( res_msg ) }
Send a protobuf rpc request to a single recipient while handling
serialization and deserialization of the request and response respectively.
Send a protobuf rpc request to a single recipient while handling serialization and deserialization of the request and response respectively .
&mut self
recipient
PeerId
protocol
ProtocolId
req_msg
TMessage
timeout
Duration
&mut self
recipient
PeerId
protocol
ProtocolId
req_msg
TMessage
timeout
Duration