pub async fn raw_command<'de, Req: Serialize, Resp: Deserialize<'de>>(
        &'de mut self,
        request: Req,
    ) -> Result<Resp, Error> {
        let req_cnt = self.send(request).await?;

        loop {
            match self.wait_response().await? {
                // push message
                None => continue,
                // response from some previous request
                // maybe due to the cancelation
                Some(cnt) if cnt < req_cnt => continue,
                // response from a future request??
                Some(cnt) if cnt > req_cnt => return Err(ErrorKind::InvalidMessageOrder.into()),
                // response from the very request
                Some(_) => break,
            }
        }

        // at this point the receiver always stores the non-push message
        Ok(from_msg(self.receiver.response().unwrap())?)
    }
/// Sends any command and get a response.
///
/// Both command and response are serialized/deserialized using [`serde`](serde).
/// See [`CommandSerializer`](crate::resp3::ser_cmd::CommandSerializer)
/// and [`Deserializer`](crate::resp3::de::Deserializer) for details.
///
/// Returned response may contain a reference to the connection's internal receive buffer.
Sends any command and get a response.
Both command and response are serialized/deserialized using [`serde`](serde).

Returned response may contain a reference to the connection's internal receive buffer.
Sends any command and get a response . Both command and response are serialized / deserialized using [ ` serde ` ] ( serde ) . Returned response may contain a reference to the connection ' s internal receive buffer .
pub async fn raw_command<'de, Req: Serialize, Resp: Deserialize<'de>>(
        &'de mut self,
        request: Req,
    ) -> Result<Resp, Error> {
        let req_cnt = self.send(request).await?;
        loop {
            match self.wait_response().await? {
                // push message
                None => continue,
                // response from some previous request
                // maybe due to the cancelation
                Some(cnt) if cnt < req_cnt => continue,
                // response from a future request??
                Some(cnt) if cnt > req_cnt => return Err(ErrorKind::InvalidMessageOrder.into()),
                // response from the very request
                Some(_) => break,
            }
        }
        // at this point the receiver always stores the non-push message
        Ok(from_msg(self.receiver.response().unwrap())?)
    }
pub async fn raw_command < ' de , Req : Serialize , Resp : Deserialize < ' de > > ( & ' de mut self , request : Req , ) -> Result < Resp , Error > { let req_cnt = self . send ( request ) . await ? ; loop { match self . wait_response ( ) . await ? { // push message None => continue , // response from some previous request // maybe due to the cancelation Some ( cnt ) if cnt < req_cnt => continue , // response from a future request?? Some ( cnt ) if cnt > req_cnt => return Err ( ErrorKind :: InvalidMessageOrder . into ( ) ) , // response from the very request Some ( _ ) => break , } } // at this point the receiver always stores the non-push message Ok ( from_msg ( self . receiver . response ( ) . unwrap ( ) ) ? ) }
Sends any command and get a response.
Sends any command and get a response .
&'de mut self
request
Req