pub trait Columns: Sized {
// Required methods
fn column(c: usize) -> Self;
fn is_column(&self) -> bool;
fn as_column(&self) -> Option<usize>;
fn as_column_mut(&mut self) -> Option<&mut usize>;
fn support_into(&self, support: &mut BTreeSet<usize>);
fn visit_columns<F>(&mut self, action: F)
where F: FnMut(&mut usize);
// Provided methods
fn support(&self) -> BTreeSet<usize> { ... }
fn permute(&mut self, permutation: &[usize]) { ... }
fn permute_map(&mut self, permutation: &BTreeMap<usize, usize>) { ... }
}Required Methods§
Sourcefn as_column(&self) -> Option<usize>
fn as_column(&self) -> Option<usize>
If self is a column, return the column index, otherwise None.
Sourcefn as_column_mut(&mut self) -> Option<&mut usize>
fn as_column_mut(&mut self) -> Option<&mut usize>
If self is a column, return a mutable reference to the column index.
Sourcefn support_into(&self, support: &mut BTreeSet<usize>)
fn support_into(&self, support: &mut BTreeSet<usize>)
Adds the support of the given set, i.e., the columns that are actually used, to the given set.
Sourcefn visit_columns<F>(&mut self, action: F)
fn visit_columns<F>(&mut self, action: F)
Visits each column reference and applies action to the column.
Useful for remapping columns, or for collecting expression support.
Provided Methods§
Sourcefn support(&self) -> BTreeSet<usize>
fn support(&self) -> BTreeSet<usize>
The support of the given set, i.e., the columns that are actually used.
You can use BTreeSet::last() to extract the maximum column.
Sourcefn permute(&mut self, permutation: &[usize])
fn permute(&mut self, permutation: &[usize])
Rewrites column indices with their value in permutation.
This method is applicable even when permutation is not a
strict permutation, and it only needs to have entries for
each column referenced in self.
Sourcefn permute_map(&mut self, permutation: &BTreeMap<usize, usize>)
fn permute_map(&mut self, permutation: &BTreeMap<usize, usize>)
Rewrites column indices with their value in permutation.
This method is applicable even when permutation is not a
strict permutation, and it only needs to have entries for
each column referenced in self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".