fn read_response(&mut self) -> RedisResult<Value> {
        let result = match self.con {
            ActualConnection::Tcp(TcpConnection { ref mut reader, .. }) => {
                self.parser.parse_value(reader)
            }
            #[cfg(feature = "tls")]
            ActualConnection::TcpTls(TcpTlsConnection { ref mut reader, .. }) => {
                self.parser.parse_value(reader)
            }
            #[cfg(unix)]
            ActualConnection::Unix(UnixConnection { ref mut sock, .. }) => {
                self.parser.parse_value(sock)
            }
        };
        // shutdown connection on protocol error
        if let Err(e) = &result {
            let shutdown = match e.as_io_error() {
                Some(e) => e.kind() == io::ErrorKind::UnexpectedEof,
                None => false,
            };
            if shutdown {
                match self.con {
                    ActualConnection::Tcp(ref mut connection) => {
                        let _ = connection.reader.shutdown(net::Shutdown::Both);
                        connection.open = false;
                    }
                    #[cfg(feature = "tls")]
                    ActualConnection::TcpTls(ref mut connection) => {
                        let _ = connection.reader.shutdown();
                        connection.open = false;
                    }
                    #[cfg(unix)]
                    ActualConnection::Unix(ref mut connection) => {
                        let _ = connection.sock.shutdown(net::Shutdown::Both);
                        connection.open = false;
                    }
                }
            }
        }
        result
    }
/// Fetches a single response from the connection.
Fetches a single response from the connection.
Fetches a single response from the connection .
fn read_response(&mut self) -> RedisResult<Value> {
        let result = match self.con {
            ActualConnection::Tcp(TcpConnection { ref mut reader, .. }) => {
                self.parser.parse_value(reader)
            }
            #[cfg(feature = "tls")]
            ActualConnection::TcpTls(TcpTlsConnection { ref mut reader, .. }) => {
                self.parser.parse_value(reader)
            }
            #[cfg(unix)]
            ActualConnection::Unix(UnixConnection { ref mut sock, .. }) => {
                self.parser.parse_value(sock)
            }
        };
        // shutdown connection on protocol error
        if let Err(e) = &result {
            let shutdown = match e.as_io_error() {
                Some(e) => e.kind() == io::ErrorKind::UnexpectedEof,
                None => false,
            };
            if shutdown {
                match self.con {
                    ActualConnection::Tcp(ref mut connection) => {
                        let _ = connection.reader.shutdown(net::Shutdown::Both);
                        connection.open = false;
                    }
                    #[cfg(feature = "tls")]
                    ActualConnection::TcpTls(ref mut connection) => {
                        let _ = connection.reader.shutdown();
                        connection.open = false;
                    }
                    #[cfg(unix)]
                    ActualConnection::Unix(ref mut connection) => {
                        let _ = connection.sock.shutdown(net::Shutdown::Both);
                        connection.open = false;
                    }
                }
            }
        }
        result
    }
fn read_response ( & mut self ) -> RedisResult < Value > { let result = match self . con { ActualConnection :: Tcp ( TcpConnection { ref mut reader , .. } ) => { self . parser . parse_value ( reader ) } # [ cfg ( feature " " ) ] ActualConnection :: TcpTls ( TcpTlsConnection { ref mut reader , .. } ) => { self . parser . parse_value ( reader ) } # [ cfg ( unix ) ] ActualConnection :: Unix ( UnixConnection { ref mut sock , .. } ) => { self . parser . parse_value ( sock ) } } ; // shutdown connection on protocol error if let Err ( e ) = & result { let shutdown = match e . as_io_error ( ) { Some ( e ) => e . kind ( ) == io :: ErrorKind :: UnexpectedEof , None => false , } ; if shutdown { match self . con { ActualConnection :: Tcp ( ref mut connection ) => { let _ = connection . reader . shutdown ( net :: Shutdown :: Both ) ; connection . open = false ; } # [ cfg ( feature " " ) ] ActualConnection :: TcpTls ( ref mut connection ) => { let _ = connection . reader . shutdown ( ) ; connection . open = false ; } # [ cfg ( unix ) ] ActualConnection :: Unix ( ref mut connection ) => { let _ = connection . sock . shutdown ( net :: Shutdown :: Both ) ; connection . open = false ; } } } } result }
Fetches a single response from the connection.
Fetches a single response from the connection .
&mut self
&mut self