fn send_append_rpc(
        &self,
    ) -> FuturesUnordered<
        impl Future<Output = std::result::Result<(usize, usize, AppendEntriesReply), std::io::Error>>,
    > {
        let rpcs = FuturesUnordered::new();
        for peer_index in 0..self.peers.len() {
            if peer_index == self.me {
                continue;
            }
            rpcs.push(self.send_single_append_rpc(peer_index));
        }
        info!(
            "[Append] S{} send append RPC to {:?} done",
            self.me, self.peers
        );
        rpcs
    }
/// Check role as leader before call this method
///
/// The results of RPC is (peer_id, next_index of this peer id, reply)
Check role as leader before call this method
The results of RPC is (peer_id, next_index of this peer id, reply)
Check role as leader before call this method The results of RPC is ( peer_id next_index of this peer id reply )
fn send_append_rpc(
        &self,
    ) -> FuturesUnordered<
        impl Future<Output = std::result::Result<(usize, usize, AppendEntriesReply), std::io::Error>>,
    > {
        let rpcs = FuturesUnordered::new();
        for peer_index in 0..self.peers.len() {
            if peer_index == self.me {
                continue;
            }
            rpcs.push(self.send_single_append_rpc(peer_index));
        }
        info!(
            "[Append] S{} send append RPC to {:?} done",
            self.me, self.peers
        );
        rpcs
    }
fn send_append_rpc ( & self , ) -> FuturesUnordered < impl Future < Output = std :: result :: Result < ( usize , usize , AppendEntriesReply ) , std :: io :: Error > > , > { let rpcs = FuturesUnordered :: new ( ) ; for peer_index in 0 .. self . peers . len ( ) { if peer_index == self . me { continue ; } rpcs . push ( self . send_single_append_rpc ( peer_index ) ) ; } info ! ( " " self me self peers ) ; rpcs }
Check role as leader before call this method
The results of RPC is (peer_id, next_index of this peer id, reply)
Check role as leader before call this method The results of RPC is ( peer_id next_index of this peer id reply )
&self
&self