pub fn discard_before(&mut self, new_begin: StreamIndex) {
        assert!(
            new_begin >= self.messages.begin(),
            "Begin index ({}) has already advanced past requested begin index ({})",
            self.messages.begin(),
            new_begin
        );
        assert!(
            new_begin <= self.messages.end(),
            "Cannot advance begin index ({}) beyond end index ({})",
            new_begin,
            self.messages.end()
        );

        while self.messages.begin() < new_begin {
            self.size_bytes -= self.messages.pop().unwrap().1.count_bytes();
            debug_assert_eq!(Self::size_bytes(&self.messages), self.size_bytes);
        }
    }
/// Garbage collects messages before `new_begin`.
Garbage collects messages before `new_begin`.
Garbage collects messages before ` new_begin ` .
pub fn discard_before(&mut self, new_begin: StreamIndex) {
        assert!(
            new_begin >= self.messages.begin(),
            "Begin index ({}) has already advanced past requested begin index ({})",
            self.messages.begin(),
            new_begin
        );
        assert!(
            new_begin <= self.messages.end(),
            "Cannot advance begin index ({}) beyond end index ({})",
            new_begin,
            self.messages.end()
        );
        while self.messages.begin() < new_begin {
            self.size_bytes -= self.messages.pop().unwrap().1.count_bytes();
            debug_assert_eq!(Self::size_bytes(&self.messages), self.size_bytes);
        }
    }
pub fn discard_before ( & mut self , new_begin : StreamIndex ) { assert ! ( new_begin self messages begin ( ) " " self messages begin ( ) new_begin ) ; assert ! ( new_begin self messages end ( ) " " new_begin self messages end ( ) ) ; while self . messages . begin ( ) < new_begin { self . size_bytes -= self . messages . pop ( ) . unwrap ( ) . 1 . count_bytes ( ) ; debug_assert_eq ! ( Self size_bytes ( self messages ) self size_bytes ) ; } }
Garbage collects messages before `new_begin`.
Garbage collects messages before ` new_begin ` .
&mut self
new_begin
StreamIndex
&mut self
new_begin
StreamIndex