Skip to main content

Columns

Trait Columns 

Source
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§

Source

fn column(c: usize) -> Self

Construct a column reference expression.

Source

fn is_column(&self) -> bool

True when the outermost structure is a column.

Source

fn as_column(&self) -> Option<usize>

If self is a column, return the column index, otherwise None.

Source

fn as_column_mut(&mut self) -> Option<&mut usize>

If self is a column, return a mutable reference to the column index.

Source

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.

Source

fn visit_columns<F>(&mut self, action: F)
where F: FnMut(&mut usize),

Visits each column reference and applies action to the column.

Useful for remapping columns, or for collecting expression support.

Provided Methods§

Source

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.

Source

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.

Source

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".

Implementors§