pub fn invalidate_to(&mut self, sequence: u32) {
        let size = sequence
            .checked_sub(self.sequence)
            .unwrap_or_else(|| u32::MAX - self.sequence + sequence) as usize;

        if size <= MAX_U32_WINDOW_SIZE as usize {
            self.sequence = sequence;
            self.size = self.size.checked_sub(size).unwrap_or(0);
            if self.size == 0 {
                self.head = 0;
            } else {
                self.head = (self.head + (size % self.buffer.len())) % self.buffer.len();
            }
        }
    }
// Invalidates cache to the certain sequence.
Invalidates cache to the certain sequence.
Invalidates cache to the certain sequence .
pub fn invalidate_to(&mut self, sequence: u32) {
        let size = sequence
            .checked_sub(self.sequence)
            .unwrap_or_else(|| u32::MAX - self.sequence + sequence) as usize;
        if size <= MAX_U32_WINDOW_SIZE as usize {
            self.sequence = sequence;
            self.size = self.size.checked_sub(size).unwrap_or(0);
            if self.size == 0 {
                self.head = 0;
            } else {
                self.head = (self.head + (size % self.buffer.len())) % self.buffer.len();
            }
        }
    }
pub fn invalidate_to ( & mut self , sequence : u32 ) { let size = sequence . checked_sub ( self . sequence ) . unwrap_or_else ( | | u32 :: MAX - self . sequence + sequence ) as usize ; if size <= MAX_U32_WINDOW_SIZE as usize { self . sequence = sequence ; self . size = self . size . checked_sub ( size ) . unwrap_or ( 0 ) ; if self . size == 0 { self . head = 0 ; } else { self . head = ( self . head + ( size % self . buffer . len ( ) ) ) % self . buffer . len ( ) ; } } }
Invalidates cache to the certain sequence.
Invalidates cache to the certain sequence .
&mut self
sequence
u32