Trait TableViewRow

Source
pub trait TableViewRow<Context> {
    // Required methods
    fn table_view_header(
        ctx: Context,
    ) -> Box<dyn AsRef<[(Cow<'static, str>, Unit, ColumnFormatting)]>>;
    fn table_view_row(&self, out: &mut Vec<(Cow<'_, str>, Highlight)>);
}

Required Methods§

Source

fn table_view_header( ctx: Context, ) -> Box<dyn AsRef<[(Cow<'static, str>, Unit, ColumnFormatting)]>>

Column names and unit. Not dyn compatible, must be static because it needs to be available for tables in the absense of rows. But to accommodate for dynamically decided changes, takes a context argument (which could be ()).

Source

fn table_view_row(&self, out: &mut Vec<(Cow<'_, str>, Highlight)>)

Write the given row to out, matching the columns in the TableViewHeader. Do not clear out inside this method!

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.

Implementors§

Source§

impl<Better: IsBetter> TableViewRow<()> for Change<Better>

Source§

impl<ViewType: From<u64> + ToStatsString + Debug, const TILE_COUNT: usize> TableViewRow<()> for StatsOrCount<ViewType, TILE_COUNT>

Source§

impl<ViewType: From<u64> + ToStatsString, const TILE_COUNT: usize> TableViewRow<SubStatsKind> for SubStats<ViewType, TILE_COUNT>

Source§

impl<ViewType: From<u64> + ToStatsString, const TILE_COUNT: usize> TableViewRow<()> for Stats<ViewType, TILE_COUNT>

Source§

impl<ViewType: Debug + From<u64> + ToStatsString, const TILE_COUNT: usize> TableViewRow<()> for StatsOrCountOrSubStats<ViewType, TILE_COUNT>