async fn request_vote(&self, args: RequestVoteArgs) -> Result<RequestVoteReply> {
        let reply = {
            let mut raft = self.inner.lock().unwrap();
            raft.request_vote(args)
        };
        // if you need to persist or call async functions here,
        // make sure the lock is scoped and dropped.
        self.persist().await.expect("failed to persist");
        Ok(reply)
    }
/// rpc handler when getting vote request from candidates
rpc handler when getting vote request from candidates
rpc handler when getting vote request from candidates
async fn request_vote(&self, args: RequestVoteArgs) -> Result<RequestVoteReply> {
        let reply = {
            let mut raft = self.inner.lock().unwrap();
            raft.request_vote(args)
        };
        // if you need to persist or call async functions here,
        // make sure the lock is scoped and dropped.
        self.persist().await.expect("failed to persist");
        Ok(reply)
    }
async fn request_vote ( & self , args : RequestVoteArgs ) -> Result < RequestVoteReply > { let reply = { let mut raft = self . inner . lock ( ) . unwrap ( ) ; raft . request_vote ( args ) } ; // if you need to persist or call async functions here, // make sure the lock is scoped and dropped. self . persist ( ) . await . expect ( " " ) ; Ok ( reply ) }
rpc handler when getting vote request from candidates
rpc handler when getting vote request from candidates
&self
args
RequestVoteArgs
&self
args
RequestVoteArgs