pub trait Columns<R: Row>:
Clone
+ PartialEq
+ 'static {
// Required methods
fn column_names(&self) -> Vec<String>;
fn headers(
&self,
) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>;
fn columns(
&self,
) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>;
fn filter(&self, row: &R) -> bool;
fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>;
}Expand description
Trait automatically implemented for tuples of TableColumns.
This trait is implemented for tuples of 1 to 12 columns via macros. You don’t need to implement this trait manually.
§Example
// Single column
let cols1 = (Col1,);
// Multiple columns (tuple)
let cols2 = (Col1, Col2);Required Methods§
Sourcefn column_names(&self) -> Vec<String>
fn column_names(&self) -> Vec<String>
Returns the names of all columns.
Sourcefn headers(
&self,
) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>
fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>
Returns header renderers for all columns.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.