pub(crate) fn become_candidate(&mut self) {
        assert_ne!(
            self.state,
            StateType::Leader,
            "invalid transition [leader -> candidate]"
        );
        // self.step = Some(Box::new(Self::step_candidate));
        self.reset(self.term + 1);
        // self.tick = Some(Box::new(tick_election));
        self.vote = self.id;
        self.state = StateType::Candidate;
        info!("{:#x} became candidate at term {}", self.id, self.term);
    }
// become_candidate transform this peer's state to candidate
become_candidate transform this peer's state to candidate
become_candidate transform this peer ' s state to candidate
pub(crate) fn become_candidate(&mut self) {
        assert_ne!(
            self.state,
            StateType::Leader,
            "invalid transition [leader -> candidate]"
        );
        // self.step = Some(Box::new(Self::step_candidate));
        self.reset(self.term + 1);
        // self.tick = Some(Box::new(tick_election));
        self.vote = self.id;
        self.state = StateType::Candidate;
        info!("{:#x} became candidate at term {}", self.id, self.term);
    }
pub ( crate ) fn become_candidate ( & mut self ) { assert_ne ! ( self state StateType Leader " " ) ; // self.step = Some(Box::new(Self::step_candidate)); self . reset ( self . term + 1 ) ; // self.tick = Some(Box::new(tick_election)); self . vote = self . id ; self . state = StateType :: Candidate ; info ! ( " " self id self term ) ; }
become_candidate transform this peer's state to candidate
become_candidate transform this peer ' s state to candidate
&mut self