Columns

Trait Columns 

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

Source

fn column_names(&self) -> Vec<String>

Returns the names of all columns.

Source

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Returns header renderers for all columns.

Source

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Returns cell renderers for all columns.

Source

fn filter(&self, row: &R) -> bool

Returns true if the row passes all column filters.

Source

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Returns comparators 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.

Implementations on Foreign Types§

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, G: TableColumn<R>, H: TableColumn<R>, I: TableColumn<R>, J: TableColumn<R>, K: TableColumn<R>, L: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, G: TableColumn<R>, H: TableColumn<R>, I: TableColumn<R>, J: TableColumn<R>, K: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F, G, H, I, J, K)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, G: TableColumn<R>, H: TableColumn<R>, I: TableColumn<R>, J: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F, G, H, I, J)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, G: TableColumn<R>, H: TableColumn<R>, I: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F, G, H, I)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, G: TableColumn<R>, H: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F, G, H)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, G: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F, G)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, F: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E, F)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, E: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D, E)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, D: TableColumn<R>, R: Row> Columns<R> for (A, B, C, D)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, C: TableColumn<R>, R: Row> Columns<R> for (A, B, C)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, B: TableColumn<R>, R: Row> Columns<R> for (A, B)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Source§

impl<A: TableColumn<R>, R: Row> Columns<R> for (A,)

Source§

fn column_names(&self) -> Vec<String>

Source§

fn headers( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, Vec<Attribute>) -> Element + '_>>

Source§

fn columns( &self, ) -> Vec<Box<dyn Fn(&TableContext<Self>, &R, Vec<Attribute>) -> Element + '_>>

Source§

fn filter(&self, row: &R) -> bool

Source§

fn compare(&self) -> Vec<Box<dyn Fn(&R, &R) -> Ordering + '_>>

Implementors§