fn consume(&mut self, amount: usize) {
        assert!(amount < self.block_size as usize);
        let block_offset_before = self.buf_file_offset % self.block_size;
        self.buf_file_offset += amount as u64;
        // If we crossed a block boundary, then the file offset needs be incremented by the size of
        // the checksum.
        if block_offset_before + amount as u64
            >= self.block_size - std::mem::size_of::<Checksum>() as u64
        {
            self.buf_file_offset += std::mem::size_of::<Checksum>() as u64;
            self.checksums.drain(0..1);
        }
        self.buf_range = self.buf_range.start + amount..self.buf_range.end;
    }
// Used after deserializing to indicate how many bytes were deserialized and adjusts the buffer
// pointers accordingly.
Used after deserializing to indicate how many bytes were deserialized and adjusts the buffer
pointers accordingly.
Used after deserializing to indicate how many bytes were deserialized and adjusts the buffer pointers accordingly .
fn consume(&mut self, amount: usize) {
        assert!(amount < self.block_size as usize);
        let block_offset_before = self.buf_file_offset % self.block_size;
        self.buf_file_offset += amount as u64;
        // If we crossed a block boundary, then the file offset needs be incremented by the size of
        // the checksum.
        if block_offset_before + amount as u64
            >= self.block_size - std::mem::size_of::<Checksum>() as u64
        {
            self.buf_file_offset += std::mem::size_of::<Checksum>() as u64;
            self.checksums.drain(0..1);
        }
        self.buf_range = self.buf_range.start + amount..self.buf_range.end;
    }
fn consume ( & mut self , amount : usize ) { assert ! ( amount self block_size as usize ) ; let block_offset_before = self . buf_file_offset % self . block_size ; self . buf_file_offset += amount as u64 ; // If we crossed a block boundary, then the file offset needs be incremented by the size of // the checksum. if block_offset_before + amount as u64 >= self . block_size - std :: mem :: size_of :: < Checksum > ( ) as u64 { self . buf_file_offset += std :: mem :: size_of :: < Checksum > ( ) as u64 ; self . checksums . drain ( 0 .. 1 ) ; } self . buf_range = self . buf_range . start + amount .. self . buf_range . end ; }
Used after deserializing to indicate how many bytes were deserialized and adjusts the buffer
pointers accordingly.
Used after deserializing to indicate how many bytes were deserialized and adjusts the buffer pointers accordingly .
&mut self
amount
usize
&mut self
amount
usize