pub fn update_from(&mut self, other: &Self) {
        let new_total_count = self.total_count() + other.total_count();

        // update all existing columns
        for col in &mut self.columns {
            if let Some(other_col) = other.column(&col.name) {
                col.update_from(other_col);
            } else {
                col.update_to_total_count(new_total_count);
            }
        }

        // Add any columns that were new
        for col in &other.columns {
            if self.column(&col.name).is_none() {
                let mut new_col = col.clone();
                // ensure the count is consistent
                new_col.update_to_total_count(new_total_count);
                self.columns.push(new_col);
            }
        }
    }
/// Updates the table summary with combined stats from the other. Counts are
/// treated as non-overlapping so they're just added together. If the
/// type of a column differs between the two tables, no update is done
/// on that column. Columns that only exist in the other are cloned into
/// this table summary.
Updates the table summary with combined stats from the other. Counts are
treated as non-overlapping so they're just added together. If the
type of a column differs between the two tables, no update is done
on that column. Columns that only exist in the other are cloned into
this table summary.
Updates the table summary with combined stats from the other . Counts are treated as non - overlapping so they ' re just added together . If the type of a column differs between the two tables no update is done on that column . Columns that only exist in the other are cloned into this table summary .
pub fn update_from(&mut self, other: &Self) {
        let new_total_count = self.total_count() + other.total_count();
        // update all existing columns
        for col in &mut self.columns {
            if let Some(other_col) = other.column(&col.name) {
                col.update_from(other_col);
            } else {
                col.update_to_total_count(new_total_count);
            }
        }
        // Add any columns that were new
        for col in &other.columns {
            if self.column(&col.name).is_none() {
                let mut new_col = col.clone();
                // ensure the count is consistent
                new_col.update_to_total_count(new_total_count);
                self.columns.push(new_col);
            }
        }
    }
pub fn update_from ( & mut self , other : & Self ) { let new_total_count = self . total_count ( ) + other . total_count ( ) ; // update all existing columns for col in & mut self . columns { if let Some ( other_col ) = other . column ( & col . name ) { col . update_from ( other_col ) ; } else { col . update_to_total_count ( new_total_count ) ; } } // Add any columns that were new for col in & other . columns { if self . column ( & col . name ) . is_none ( ) { let mut new_col = col . clone ( ) ; // ensure the count is consistent new_col . update_to_total_count ( new_total_count ) ; self . columns . push ( new_col ) ; } } }
Updates the table summary with combined stats from the other.
Updates the table summary with combined stats from the other .
&mut self
other
&Self
&mut self
other
&Self