pub(crate) fn advance(&mut self, m: Message) -> Vec<ReadIndexStatus> {
        let mut rss: Vec<ReadIndexStatus> = vec![];
        let mut i = 0;
        let mut found = false;
        for ok_ctx in &self.read_index_queue {
            i += 1;
            let rs = self.pending_read_index.get(ok_ctx);
            if rs.is_none() {
                panic!("cannot find corresponding read state from pending map");
            }
            let rs = rs.unwrap();
            rss.push(rs.clone());
            if ok_ctx.as_slice() == m.get_context() {
                found = true;
                break;
            }
        }
        if found {
            self.read_index_queue.drain(..i);
            rss.iter().for_each(|rs| {
                self.pending_read_index
                    .remove(rs.req.get_entries()[0].get_Data());
            });
            return rss;
        }
        vec![]
    }
// Advances the read only request queue kept by the read_only struct.
// It dequeues the requests until it finds the read only request that has
// the same context as the given `m`.
Advances the read only request queue kept by the read_only struct.
It dequeues the requests until it finds the read only request that has
the same context as the given `m`.
Advances the read only request queue kept by the read_only struct . It dequeues the requests until it finds the read only request that has the same context as the given ` m ` .
pub(crate) fn advance(&mut self, m: Message) -> Vec<ReadIndexStatus> {
        let mut rss: Vec<ReadIndexStatus> = vec![];
        let mut i = 0;
        let mut found = false;
        for ok_ctx in &self.read_index_queue {
            i += 1;
            let rs = self.pending_read_index.get(ok_ctx);
            if rs.is_none() {
                panic!("cannot find corresponding read state from pending map");
            }
            let rs = rs.unwrap();
            rss.push(rs.clone());
            if ok_ctx.as_slice() == m.get_context() {
                found = true;
                break;
            }
        }
        if found {
            self.read_index_queue.drain(..i);
            rss.iter().for_each(|rs| {
                self.pending_read_index
                    .remove(rs.req.get_entries()[0].get_Data());
            });
            return rss;
        }
        vec![]
    }
pub ( crate ) fn advance ( & mut self , m : Message ) -> Vec < ReadIndexStatus > { let mut rss : Vec < ReadIndexStatus > = vec ! [ ] ; let mut i = 0 ; let mut found = false ; for ok_ctx in & self . read_index_queue { i += 1 ; let rs = self . pending_read_index . get ( ok_ctx ) ; if rs . is_none ( ) { panic ! ( " " ) ; } let rs = rs . unwrap ( ) ; rss . push ( rs . clone ( ) ) ; if ok_ctx . as_slice ( ) == m . get_context ( ) { found = true ; break ; } } if found { self . read_index_queue . drain ( .. i ) ; rss . iter ( ) . for_each ( | rs | { self . pending_read_index . remove ( rs . req . get_entries ( ) [ 0 ] . get_Data ( ) ) ; } ) ; return rss ; } vec ! [ ] }
Advances the read only request queue kept by the read_only struct.
Advances the read only request queue kept by the read_only struct .
&mut self
m
Message