Trait OutputTable

Source
pub trait OutputTable {
    type Output;

    // Required methods
    fn num_columns(&self) -> usize;
    fn write_row<'url, V: CellValue<'url>>(
        &mut self,
        row: Row<'_, '_, V>,
        line_style: Option<OutputStyle>,
    ) -> Result<()>;
    fn write_title_row(
        &mut self,
        titles: &[OutputTableTitle<'_>],
        line_style: Option<OutputStyle>,
    ) -> Result<()>;
    fn write_bar(
        &mut self,
        bar_kind: BarKind,
        anchor_name: Option<&str>,
    ) -> Result<()>;
    fn print<'url, V: CellValue<'url>>(&mut self, value: V) -> Result<()>;
    fn finish(self) -> Result<Self::Output>;

    // Provided method
    fn write_data_row<'url, V: CellValue<'url>>(
        &mut self,
        data: &[V],
        line_style: Option<OutputStyle>,
    ) -> Result<()> { ... }
}

Required Associated Types§

Required Methods§

Source

fn num_columns(&self) -> usize

How many columns this table has (each row has the same number of columns, although cells can span multiple columns)

Source

fn write_row<'url, V: CellValue<'url>>( &mut self, row: Row<'_, '_, V>, line_style: Option<OutputStyle>, ) -> Result<()>

Normally, use write_title_row or write_data_row instead!

Source

fn write_title_row( &mut self, titles: &[OutputTableTitle<'_>], line_style: Option<OutputStyle>, ) -> Result<()>

Source

fn write_bar( &mut self, bar_kind: BarKind, anchor_name: Option<&str>, ) -> Result<()>

Source

fn print<'url, V: CellValue<'url>>(&mut self, value: V) -> Result<()>

Source

fn finish(self) -> Result<Self::Output>

Provided Methods§

Source

fn write_data_row<'url, V: CellValue<'url>>( &mut self, data: &[V], line_style: Option<OutputStyle>, ) -> Result<()>

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<'allocator> OutputTable for HtmlTable<'allocator>

Source§

type Output = AVec<'allocator, Node>

Source§

impl<O: Write + IsTerminal> OutputTable for TerminalTable<O>