fn recv_all_commands(
        &self,
        results: &mut Vec<Value>,
        node_cmds: &[NodeCmd],
    ) -> RedisResult<Vec<usize>> {
        let mut to_retry = Vec::new();
        let mut connections = self.connections.borrow_mut();
        let mut first_err = None;

        for nc in node_cmds {
            for cmd_idx in &nc.indexes {
                match self
                    .get_connection_by_addr(&mut connections, &nc.addr)?
                    .recv_response()
                {
                    Ok(item) => results[*cmd_idx] = item,
                    Err(err) if err.is_cluster_error() => to_retry.push(*cmd_idx),
                    Err(err) => first_err = first_err.or(Some(err)),
                }
            }
        }
        match first_err {
            Some(err) => Err(err),
            None => Ok(to_retry),
        }
    }
// Receive from each node, keeping track of which commands need to be retried.
Receive from each node, keeping track of which commands need to be retried.
Receive from each node keeping track of which commands need to be retried .
fn recv_all_commands(
        &self,
        results: &mut Vec<Value>,
        node_cmds: &[NodeCmd],
    ) -> RedisResult<Vec<usize>> {
        let mut to_retry = Vec::new();
        let mut connections = self.connections.borrow_mut();
        let mut first_err = None;
        for nc in node_cmds {
            for cmd_idx in &nc.indexes {
                match self
                    .get_connection_by_addr(&mut connections, &nc.addr)?
                    .recv_response()
                {
                    Ok(item) => results[*cmd_idx] = item,
                    Err(err) if err.is_cluster_error() => to_retry.push(*cmd_idx),
                    Err(err) => first_err = first_err.or(Some(err)),
                }
            }
        }
        match first_err {
            Some(err) => Err(err),
            None => Ok(to_retry),
        }
    }
fn recv_all_commands ( & self , results : & mut Vec < Value > , node_cmds : & [ NodeCmd ] , ) -> RedisResult < Vec < usize > > { let mut to_retry = Vec :: new ( ) ; let mut connections = self . connections . borrow_mut ( ) ; let mut first_err = None ; for nc in node_cmds { for cmd_idx in & nc . indexes { match self . get_connection_by_addr ( & mut connections , & nc . addr ) ? . recv_response ( ) { Ok ( item ) => results [ * cmd_idx ] = item , Err ( err ) if err . is_cluster_error ( ) => to_retry . push ( * cmd_idx ) , Err ( err ) => first_err = first_err . or ( Some ( err ) ) , } } } match first_err { Some ( err ) => Err ( err ) , None => Ok ( to_retry ) , } }
Receive from each node, keeping track of which commands need to be retried.
Receive from each node keeping track of which commands need to be retried .
&self
results
&mut Vec<Value>
node_cmds
&[NodeCmd]
&self
results
&mut Vec<Value>
node_cmds
&[NodeCmd]