Trait TableOption

Source
pub trait TableOption<R, C, D> {
    // Required method
    fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D);

    // Provided method
    fn hint_change(&self) -> Option<Entity> { ... }
}
Expand description

A trait which is responsible for configuration of a Table.

Required Methods§

Source

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

The function modificaties of records and a grid configuration.

Provided Methods§

Source

fn hint_change(&self) -> Option<Entity>

A hint whether an TableOption is going to change table layout.

Return None if no changes are being done. Otherwise return:

  • Entity::Global - a grand layout changed. (a change which MIGHT require height/width update)
  • Entity::Row - a certain row was changed. (a change which MIGHT require height update)
  • Entity::Column - a certain column was changed. (a change which MIGHT require width update)
  • Entity::Cell - a certain cell was changed. (a local change, no width/height update)

By default it’s considered to be a grand change.

This methods primarily is used as an optimization, to not make unnecessary calculations if they’re not needed, after using the TableOption.

Implementations on Foreign Types§

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>, T4: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3, T4)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>, T4: TableOption<R, C, D>, T5: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3, T4, T5)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>, T4: TableOption<R, C, D>, T5: TableOption<R, C, D>, T6: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>, T4: TableOption<R, C, D>, T5: TableOption<R, C, D>, T6: TableOption<R, C, D>, T7: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>, T4: TableOption<R, C, D>, T5: TableOption<R, C, D>, T6: TableOption<R, C, D>, T7: TableOption<R, C, D>, T8: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<R, C, D, T0: TableOption<R, C, D>, T1: TableOption<R, C, D>, T2: TableOption<R, C, D>, T3: TableOption<R, C, D>, T4: TableOption<R, C, D>, T5: TableOption<R, C, D>, T6: TableOption<R, C, D>, T7: TableOption<R, C, D>, T8: TableOption<R, C, D>, T9: TableOption<R, C, D>> TableOption<R, C, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

fn hint_change(&self) -> Option<Entity>

Source§

impl<T, R, C, D> TableOption<R, C, D> for &[T]
where for<'a> &'a T: TableOption<R, C, D>,

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Source§

impl<T, R, D, C> TableOption<R, C, D> for Vec<T>
where T: TableOption<R, C, D>,

Source§

fn change(self, records: &mut R, cfg: &mut C, dimension: &mut D)

Implementors§

Source§

impl TableOption<VecRecords<Text<String>>, ColoredConfig, CompleteDimension> for ColumnNames

Source§

impl<Data, D> TableOption<Data, ColoredConfig, D> for BorderColor
where Data: Records + ExactRecords,

Source§

impl<Dst, Src, R, D, C> TableOption<R, C, D> for Dup<Dst, Src>

Source§

impl<F, R, D, C> TableOption<R, C, D> for FormatConfig<F>
where F: FnMut(&mut C),

Source§

impl<F, R, D, C> TableOption<R, C, D> for FormatContent<F>

Source§

impl<F, R, D, C> TableOption<R, C, D> for FormatContentPositioned<F>

Source§

impl<L, R, D, C> TableOption<R, C, D> for Remove<L, TargetColumn>
where L: Location<R, Coordinate = usize>, R: Records + Resizable,

Source§

impl<L, R, D, C> TableOption<R, C, D> for Remove<L, TargetRow>
where L: Location<R, Coordinate = usize>, R: ExactRecords + Resizable,

Source§

impl<O, M, R, D, C> TableOption<R, C, D> for ModifyList<O, M>
where O: Object<R>, M: CellOption<R, C> + Clone, R: Records + ExactRecords,

Source§

impl<O, R, D> TableOption<R, ColoredConfig, D> for Highlight<O>
where O: Object<R>, R: Records + ExactRecords,

Source§

impl<R, C> TableOption<R, C, CompleteDimension> for HeightList
where R: ExactRecords + Records,

Source§

impl<R, C> TableOption<R, C, CompleteDimension> for WidthList
where R: Records,

Source§

impl<R, C> TableOption<R, C, PoolTableDimension> for PoolTableDimension

Source§

impl<R, C, D> TableOption<R, C, D> for Layout

Source§

impl<R, C, RR, D, Cfg> TableOption<RR, Cfg, D> for Extract<R, C>

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for &SpannedConfig

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for AlignmentStrategy

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for TrimStrategy

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for PaddingExpand
where R: Records + ExactRecords + PeekableRecords, for<'a> &'a R: Records, for<'a> <<&'a R as Records>::Iter as IntoRecords>::Cell: AsRef<str>,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for tabled::grid::config::Border<char>

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Borders<char>

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for ColoredConfig

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for CompactConfig

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for SpannedConfig

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Justification

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for MergeDuplicatesHorizontal

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for MergeDuplicatesVertical

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Alignment

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Color

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Margin

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Padding

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Shadow

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<Column>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<FirstColumn>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<FirstRow>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<LastColumn>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<LastColumnOffset>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<LastRow>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<LastRowOffset>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for LineText<Row>
where R: Records + ExactRecords, for<'a> &'a R: Records, for<'a> D: Estimate<&'a R, ColoredConfig> + Dimension,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for BorderCorrection
where R: Records + ExactRecords,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Colorization
where R: Records + ExactRecords,

Source§

impl<R, D> TableOption<R, ColoredConfig, D> for Theme

Source§

impl<R, D> TableOption<R, CompactConfig, D> for Borders<char>

Source§

impl<R, D> TableOption<R, CompactConfig, D> for CompactConfig

Source§

impl<R, D> TableOption<R, CompactConfig, D> for Alignment

Source§

impl<R, D> TableOption<R, CompactConfig, D> for Margin

Source§

impl<R, D> TableOption<R, CompactConfig, D> for Padding

Source§

impl<R, D> TableOption<R, CompactConfig, D> for Theme

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for AlignmentStrategy

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for Borders<char>

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for CompactMultilineConfig

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for Alignment

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for Margin

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for Padding

Source§

impl<R, D> TableOption<R, CompactMultilineConfig, D> for Theme

Source§

impl<R, D, C> TableOption<R, ColoredConfig, D> for MarginColor<C>
where C: Into<ANSIBuf> + Clone,

Source§

impl<R, D, C> TableOption<R, ColoredConfig, D> for PaddingColor<C>
where C: Into<ANSIBuf> + Clone,

Source§

impl<R, D, C> TableOption<R, CompactConfig, D> for MarginColor<C>
where C: Into<ANSIStr<'static>> + Clone,

Source§

impl<R, D, C> TableOption<R, CompactConfig, D> for PaddingColor<C>
where C: Into<ANSIStr<'static>> + Clone,

Source§

impl<R, D, C> TableOption<R, CompactMultilineConfig, D> for MarginColor<C>
where C: Into<ANSIStr<'static>> + Clone,

Source§

impl<R, D, C> TableOption<R, CompactMultilineConfig, D> for PaddingColor<C>
where C: Into<ANSIStr<'static>> + Clone,

Source§

impl<R, D, C> TableOption<R, C, D> for Rotate

Source§

impl<R, D, C> TableOption<R, C, D> for CleanCharset

Source§

impl<R, D, C> TableOption<R, C, D> for TabSize

Source§

impl<R, D, C> TableOption<R, C, D> for Split

Source§

impl<R, D, C> TableOption<R, C, D> for Concat

Source§

impl<R, D, C> TableOption<R, C, D> for EmptySettings

Source§

impl<R, D, C> TableOption<R, C, D> for Reverse

Source§

impl<R, D, C, A, B> TableOption<R, C, D> for Settings<A, B>
where A: TableOption<R, C, D>, B: TableOption<R, C, D>,

Source§

impl<R, D, O> TableOption<R, ColoredConfig, D> for ExactColorization<O>
where O: Object<R>,

Source§

impl<R, D, W> TableOption<R, ColoredConfig, D> for Justify<W>

Source§

impl<R, W> TableOption<R, ColoredConfig, CompleteDimension> for CellHeightIncrease<W>

Source§

impl<R, W> TableOption<R, ColoredConfig, CompleteDimension> for CellHeightLimit<W>

Source§

impl<R, W, P> TableOption<R, ColoredConfig, CompleteDimension> for TableHeightIncrease<W, P>

Source§

impl<R, W, P> TableOption<R, ColoredConfig, CompleteDimension> for TableHeightLimit<W, P>

Source§

impl<S, R, D> TableOption<R, ColoredConfig, D> for Footer<S>

Source§

impl<S, R, D> TableOption<R, ColoredConfig, D> for Header<S>

Source§

impl<S, R, D> TableOption<R, ColoredConfig, D> for HorizontalPanel<S>

Source§

impl<S, R, D> TableOption<R, ColoredConfig, D> for VerticalPanel<S>

Source§

impl<T, B, L, R, Data, D> TableOption<Data, ColoredConfig, D> for tabled::settings::style::Border<T, B, L, R>
where Data: Records + ExactRecords,

Source§

impl<T, B, L, R, H, V, Data, Dims, const HSIZE: usize, const VSIZE: usize> TableOption<Data, ColoredConfig, Dims> for Style<T, B, L, R, H, V, HSIZE, VSIZE>

Source§

impl<T, B, L, R, H, V, Data, Dims, const HSIZE: usize, const VSIZE: usize> TableOption<Data, CompactConfig, Dims> for Style<T, B, L, R, H, V, HSIZE, VSIZE>

Source§

impl<T, B, L, R, H, V, Data, Dims, const HSIZE: usize, const VSIZE: usize> TableOption<Data, CompactMultilineConfig, Dims> for Style<T, B, L, R, H, V, HSIZE, VSIZE>

Source§

impl<W, P, R> TableOption<R, ColoredConfig, CompleteDimension> for MinWidth<W, P>

Source§

impl<W, P, R> TableOption<R, ColoredConfig, CompleteDimension> for Truncate<'_, W, P>

Source§

impl<W, P, R> TableOption<R, ColoredConfig, CompleteDimension> for Wrap<W, P>