pub async fn last_log_id(&self) -> LogId {
        let log_last_id = {
            let log_last = self.log.read().await;
            log_last.iter().last().map(|(_k, v)| v.log_id).unwrap_or_default()
        };

        let sm_last_id = self.sm.read().await.last_applied_log;

        std::cmp::max(log_last_id, sm_last_id)
    }
/// Find the last known log id from log or state machine
/// If no log id found, the default one `0,0` is returned.
Find the last known log id from log or state machine
If no log id found, the default one `0,0` is returned.
Find the last known log id from log or state machine If no log id found the default one ` 0 0 ` is returned .
pub async fn last_log_id(&self) -> LogId {
        let log_last_id = {
            let log_last = self.log.read().await;
            log_last.iter().last().map(|(_k, v)| v.log_id).unwrap_or_default()
        };
        let sm_last_id = self.sm.read().await.last_applied_log;
        std::cmp::max(log_last_id, sm_last_id)
    }
pub async fn last_log_id ( & self ) -> LogId { let log_last_id = { let log_last = self . log . read ( ) . await ; log_last . iter ( ) . last ( ) . map ( | ( _k , v ) | v . log_id ) . unwrap_or_default ( ) } ; let sm_last_id = self . sm . read ( ) . await . last_applied_log ; std :: cmp :: max ( log_last_id , sm_last_id ) }
Find the last known log id from log or state machine
If no log id found, the default one `0,0` is returned.
Find the last known log id from log or state machine If no log id found the default one ` 0 0 ` is returned .
&self
&self