fn purge_below(&mut self, expiry: Time) -> Box<dyn Iterator<Item = T> + '_> {
        let _timer = self
            .metrics
            .op_duration
            .with_label_values(&["purge_below"])
            .start_timer();
        let zero_bytes = [0; EXPECTED_MESSAGE_ID_LENGTH];
        let key = IngressMessageId::new(expiry, MessageId::from(zero_bytes));
        let mut to_remove = self.artifacts.split_off(&key);
        std::mem::swap(&mut to_remove, &mut self.artifacts);
        for artifact in to_remove.values() {
            self.metrics.observe_remove(artifact.as_ref().count_bytes());
        }
        Box::new(to_remove.into_iter().map(|(_, v)| v))
    }
// Purge below an expiry prefix (non-inclusive), and return the purged artifacts
// as an iterator.
Purge below an expiry prefix (non-inclusive), and return the purged artifacts
as an iterator.
Purge below an expiry prefix ( non - inclusive ) and return the purged artifacts as an iterator .
fn purge_below(&mut self, expiry: Time) -> Box<dyn Iterator<Item = T> + '_> {
        let _timer = self
            .metrics
            .op_duration
            .with_label_values(&["purge_below"])
            .start_timer();
        let zero_bytes = [0; EXPECTED_MESSAGE_ID_LENGTH];
        let key = IngressMessageId::new(expiry, MessageId::from(zero_bytes));
        let mut to_remove = self.artifacts.split_off(&key);
        std::mem::swap(&mut to_remove, &mut self.artifacts);
        for artifact in to_remove.values() {
            self.metrics.observe_remove(artifact.as_ref().count_bytes());
        }
        Box::new(to_remove.into_iter().map(|(_, v)| v))
    }
fn purge_below ( & mut self , expiry : Time ) -> Box < dyn Iterator < Item = T > + ' _ > { let _timer = self . metrics . op_duration . with_label_values ( & [ " " ] ) . start_timer ( ) ; let zero_bytes = [ 0 ; EXPECTED_MESSAGE_ID_LENGTH ] ; let key = IngressMessageId :: new ( expiry , MessageId :: from ( zero_bytes ) ) ; let mut to_remove = self . artifacts . split_off ( & key ) ; std :: mem :: swap ( & mut to_remove , & mut self . artifacts ) ; for artifact in to_remove . values ( ) { self . metrics . observe_remove ( artifact . as_ref ( ) . count_bytes ( ) ) ; } Box :: new ( to_remove . into_iter ( ) . map ( | ( _ , v ) | v ) ) }
Purge below an expiry prefix (non-inclusive), and return the purged artifacts
as an iterator.
Purge below an expiry prefix ( non - inclusive ) and return the purged artifacts as an iterator .
&mut self
expiry
Time
&mut self
expiry
Time