fn clean_old_records(&mut self) {
        let record_ptr = &self.record_buffer[0];
        let curr_size = size_of_val(record_ptr) * self.record_buffer.len();
        if curr_size > (self.buffer_max_kbytes * 1000) as usize {
            let size_diff = curr_size - (self.buffer_max_kbytes * 1000) as usize;
            if size_diff > size_of_val(&self.record_buffer[0]) {
                let nb_records_to_delete =
                    size_diff as f32 / size_of_val(&self.record_buffer[0]) as f32;
                for _ in 1..nb_records_to_delete as u32 {
                    if !self.record_buffer.is_empty() {
                        self.record_buffer.remove(0);
                    }
                }
            }
        }
    }
/// Removes as many Record instances from self.record_buffer as needed
/// for record_buffer to take less than 'buffer_max_kbytes' in memory
Removes as many Record instances from self.record_buffer as needed
for record_buffer to take less than 'buffer_max_kbytes' in memory
Removes as many Record instances from self . record_buffer as needed for record_buffer to take less than ' buffer_max_kbytes ' in memory
fn clean_old_records(&mut self) {
        let record_ptr = &self.record_buffer[0];
        let curr_size = size_of_val(record_ptr) * self.record_buffer.len();
        if curr_size > (self.buffer_max_kbytes * 1000) as usize {
            let size_diff = curr_size - (self.buffer_max_kbytes * 1000) as usize;
            if size_diff > size_of_val(&self.record_buffer[0]) {
                let nb_records_to_delete =
                    size_diff as f32 / size_of_val(&self.record_buffer[0]) as f32;
                for _ in 1..nb_records_to_delete as u32 {
                    if !self.record_buffer.is_empty() {
                        self.record_buffer.remove(0);
                    }
                }
            }
        }
    }
fn clean_old_records ( & mut self ) { let record_ptr = & self . record_buffer [ 0 ] ; let curr_size = size_of_val ( record_ptr ) * self . record_buffer . len ( ) ; if curr_size > ( self . buffer_max_kbytes * 1000 ) as usize { let size_diff = curr_size - ( self . buffer_max_kbytes * 1000 ) as usize ; if size_diff > size_of_val ( & self . record_buffer [ 0 ] ) { let nb_records_to_delete = size_diff as f32 / size_of_val ( & self . record_buffer [ 0 ] ) as f32 ; for _ in 1 .. nb_records_to_delete as u32 { if ! self . record_buffer . is_empty ( ) { self . record_buffer . remove ( 0 ) ; } } } } }
Removes as many Record instances from self.record_buffer as needed
for record_buffer to take less than 'buffer_max_kbytes' in memory
Removes as many Record instances from self . record_buffer as needed for record_buffer to take less than ' buffer_max_kbytes ' in memory
&mut self
&mut self