pub fn clear_all(&mut self, notify_removed: Option<u64>) {
        let mut removed = 0;
        for mut read in self.reads.drain(..) {
            removed += read.cmds.len();
            if let Some(region_id) = notify_removed {
                for (_, cb, _) in read.cmds.drain(..) {
                    apply::notify_req_region_removed(region_id, cb);
                }
            } else {
                read.cmds.clear();
            }
        }
        RAFT_READ_INDEX_PENDING_COUNT.sub(removed as i64);
        self.contexts.clear();
        self.ready_cnt = 0;
        self.handled_cnt = 0;
    }
/// Clear all commands in the queue. if `notify_removed` contains an `region_id`,
/// notify the request's callback that the region is removed.
Clear all commands in the queue. if `notify_removed` contains an `region_id`,
notify the request's callback that the region is removed.
Clear all commands in the queue . if ` notify_removed ` contains an ` region_id ` notify the request ' s callback that the region is removed .
pub fn clear_all(&mut self, notify_removed: Option<u64>) {
        let mut removed = 0;
        for mut read in self.reads.drain(..) {
            removed += read.cmds.len();
            if let Some(region_id) = notify_removed {
                for (_, cb, _) in read.cmds.drain(..) {
                    apply::notify_req_region_removed(region_id, cb);
                }
            } else {
                read.cmds.clear();
            }
        }
        RAFT_READ_INDEX_PENDING_COUNT.sub(removed as i64);
        self.contexts.clear();
        self.ready_cnt = 0;
        self.handled_cnt = 0;
    }
pub fn clear_all ( & mut self , notify_removed : Option < u64 > ) { let mut removed = 0 ; for mut read in self . reads . drain ( .. ) { removed += read . cmds . len ( ) ; if let Some ( region_id ) = notify_removed { for ( _ , cb , _ ) in read . cmds . drain ( .. ) { apply :: notify_req_region_removed ( region_id , cb ) ; } } else { read . cmds . clear ( ) ; } } RAFT_READ_INDEX_PENDING_COUNT . sub ( removed as i64 ) ; self . contexts . clear ( ) ; self . ready_cnt = 0 ; self . handled_cnt = 0 ; }
Clear all commands in the queue.
Clear all commands in the queue .
&mut self
notify_removed
Option<u64>