/// Perform a single request and single response
Perform a single request and single response
Perform a single request and single response
pub async fn request_response<T, R, M>(&mut self, request: T, method: M) -> Result<R, RpcError>
    where
        T: prost::Message,
        R: prost::Message + Default + std::fmt::Debug,
        M: Into<RpcMethod>,
    {
        let req_bytes = request.to_encoded_bytes();
        let request = BaseRequest::new(method.into(), req_bytes.into());
        let mut resp = self.call_inner(request).await?;
        let resp = resp.next().await.ok_or(RpcError::ServerClosedRequest)??;
        let resp = R::decode(resp.into_message())?;
        Ok(resp)
    }
pub async fn request_response < T , R , M > ( & mut self , request : T , method : M ) -> Result < R , RpcError > where T : prost :: Message , R : prost :: Message + Default + std :: fmt :: Debug , M : Into < RpcMethod > , { let req_bytes = request . to_encoded_bytes ( ) ; let request = BaseRequest :: new ( method . into ( ) , req_bytes . into ( ) ) ; let mut resp = self . call_inner ( request ) . await ? ; let resp = resp . next ( ) . await . ok_or ( RpcError :: ServerClosedRequest ) ? ? ; let resp = R :: decode ( resp . into_message ( ) ) ? ; Ok ( resp ) }
Perform a single request and single response
Perform a single request and single response
&mut self
request
T
method
M