fn apply_once(&mut self) {
        let mut applied = 0;
        while applied < MAX_APPLIED_ONCE && self.state.commit_index > self.state.last_applied {
            self.state.last_applied += 1;
            applied += 1;
            info!(
                "[Apply] Server {} apply log {}",
                self.me, self.state.last_applied
            );
            let log = &self.logs[self.log_index_to_idx(self.state.last_applied)];
            let msg = ApplyMsg::Command {
                data: log.entry.clone(),
                index: self.state.last_applied,
            };
            self.apply_ch.unbounded_send(msg).unwrap();
        }
    }
// apply at most `MAX_APPLIED_ONCE` committed logs to state machine if availiable
apply at most `MAX_APPLIED_ONCE` committed logs to state machine if availiable
apply at most ` MAX_APPLIED_ONCE ` committed logs to state machine if availiable
fn apply_once(&mut self) {
        let mut applied = 0;
        while applied < MAX_APPLIED_ONCE && self.state.commit_index > self.state.last_applied {
            self.state.last_applied += 1;
            applied += 1;
            info!(
                "[Apply] Server {} apply log {}",
                self.me, self.state.last_applied
            );
            let log = &self.logs[self.log_index_to_idx(self.state.last_applied)];
            let msg = ApplyMsg::Command {
                data: log.entry.clone(),
                index: self.state.last_applied,
            };
            self.apply_ch.unbounded_send(msg).unwrap();
        }
    }
fn apply_once ( & mut self ) { let mut applied = 0 ; while applied < MAX_APPLIED_ONCE && self . state . commit_index > self . state . last_applied { self . state . last_applied += 1 ; applied += 1 ; info ! ( " " self me self state last_applied ) ; let log = & self . logs [ self . log_index_to_idx ( self . state . last_applied ) ] ; let msg = ApplyMsg :: Command { data : log . entry . clone ( ) , index : self . state . last_applied , } ; self . apply_ch . unbounded_send ( msg ) . unwrap ( ) ; } }
apply at most `MAX_APPLIED_ONCE` committed logs to state machine if availiable
apply at most ` MAX_APPLIED_ONCE ` committed logs to state machine if availiable
&mut self
&mut self