pub fn min_file_seq(&self, queue: LogQueue) -> Option<FileSeq> {
        let entry = match queue {
            LogQueue::Append => self.entry_indexes.get(self.rewrite_count),
            LogQueue::Rewrite if self.rewrite_count == 0 => None,
            LogQueue::Rewrite => self.entry_indexes.front(),
        };
        let ents_min = entry.map(|e| e.entries.unwrap().id.seq);
        let kvs_min = self
            .kvs
            .values()
            .filter(|v| v.1.queue == queue)
            .fold(None, |min, v| {
                if let Some(min) = min {
                    Some(std::cmp::min(min, v.1.seq))
                } else {
                    Some(v.1.seq)
                }
            });
        match (ents_min, kvs_min) {
            (Some(ents_min), Some(kvs_min)) => Some(std::cmp::min(kvs_min, ents_min)),
            (Some(ents_min), None) => Some(ents_min),
            (None, Some(kvs_min)) => Some(kvs_min),
            (None, None) => None,
        }
    }
/// Returns the smallest file sequence number of entries or key value pairs
/// in this table.
Returns the smallest file sequence number of entries or key value pairs
in this table.
Returns the smallest file sequence number of entries or key value pairs in this table .
pub fn min_file_seq(&self, queue: LogQueue) -> Option<FileSeq> {
        let entry = match queue {
            LogQueue::Append => self.entry_indexes.get(self.rewrite_count),
            LogQueue::Rewrite if self.rewrite_count == 0 => None,
            LogQueue::Rewrite => self.entry_indexes.front(),
        };
        let ents_min = entry.map(|e| e.entries.unwrap().id.seq);
        let kvs_min = self
            .kvs
            .values()
            .filter(|v| v.1.queue == queue)
            .fold(None, |min, v| {
                if let Some(min) = min {
                    Some(std::cmp::min(min, v.1.seq))
                } else {
                    Some(v.1.seq)
                }
            });
        match (ents_min, kvs_min) {
            (Some(ents_min), Some(kvs_min)) => Some(std::cmp::min(kvs_min, ents_min)),
            (Some(ents_min), None) => Some(ents_min),
            (None, Some(kvs_min)) => Some(kvs_min),
            (None, None) => None,
        }
    }
pub fn min_file_seq ( & self , queue : LogQueue ) -> Option < FileSeq > { let entry = match queue { LogQueue :: Append => self . entry_indexes . get ( self . rewrite_count ) , LogQueue :: Rewrite if self . rewrite_count == 0 => None , LogQueue :: Rewrite => self . entry_indexes . front ( ) , } ; let ents_min = entry . map ( | e | e . entries . unwrap ( ) . id . seq ) ; let kvs_min = self . kvs . values ( ) . filter ( | v | v . 1 . queue == queue ) . fold ( None , | min , v | { if let Some ( min ) = min { Some ( std :: cmp :: min ( min , v . 1 . seq ) ) } else { Some ( v . 1 . seq ) } } ) ; match ( ents_min , kvs_min ) { ( Some ( ents_min ) , Some ( kvs_min ) ) => Some ( std :: cmp :: min ( kvs_min , ents_min ) ) , ( Some ( ents_min ) , None ) => Some ( ents_min ) , ( None , Some ( kvs_min ) ) => Some ( kvs_min ) , ( None , None ) => None , } }
Returns the smallest file sequence number of entries or key value pairs
in this table.
Returns the smallest file sequence number of entries or key value pairs in this table .
&self
queue
LogQueue