pub(crate) async fn read_value(mut stream: &mut TcpStream) -> Result<Value> {
        let buf = read_until(&mut stream, b'\n').await?;
        match buf[0] {
            b'+' | b'-' | b':' => Self::parse_simple_value(&buf).await,
            b'$' => Self::parse_string(&buf, &mut stream).await,
            b'*' => Self::parse_array(&buf, &mut stream).await,
            _ => Err(Error::UnexpectedResponse(
                String::from_utf8_lossy(&buf).to_string(),
            )),
        }
    }
//Read a value from the connection.
Read a value from the connection.
Read a value from the connection .
pub(crate) async fn read_value(mut stream: &mut TcpStream) -> Result<Value> {
        let buf = read_until(&mut stream, b'\n').await?;
        match buf[0] {
            b'+' | b'-' | b':' => Self::parse_simple_value(&buf).await,
            b'$' => Self::parse_string(&buf, &mut stream).await,
            b'*' => Self::parse_array(&buf, &mut stream).await,
            _ => Err(Error::UnexpectedResponse(
                String::from_utf8_lossy(&buf).to_string(),
            )),
        }
    }
pub ( crate ) async fn read_value ( mut stream : & mut TcpStream ) -> Result < Value > { let buf = read_until ( & mut stream , b'\n' ) . await ? ; match buf [ 0 ] { b'+' | b'-' | b':' => Self :: parse_simple_value ( & buf ) . await , b'$' => Self :: parse_string ( & buf , & mut stream ) . await , b'*' => Self :: parse_array ( & buf , & mut stream ) . await , _ => Err ( Error :: UnexpectedResponse ( String :: from_utf8_lossy ( & buf ) . to_string ( ) , ) ) , } }
Read a value from the connection.
Read a value from the connection .
stream
&mut TcpStream
stream
&mut TcpStream