pub trait TableFormatter<'data> {
// Required method
fn fmt<'context>(&'data self, c: &mut Context<'context>) -> Result;
// Provided methods
fn table_to_string(&'data self) -> String { ... }
fn table_to_string_with_format<'context, Styles>(
&'data self,
styles: &'context Styles,
) -> String
where Styles: TableOutputFormat { ... }
}
Expand description
Trait for defining table formatting logic.
TableFormatter
allows implementations to specify how tables are formatted
and displayed, providing flexibility in presentation.
§Type Parameters
'data
: The lifetime of the data being formatted.
Required Methods§
Provided Methods§
Sourcefn table_to_string(&'data self) -> String
fn table_to_string(&'data self) -> String
Sourcefn table_to_string_with_format<'context, Styles>(
&'data self,
styles: &'context Styles,
) -> Stringwhere
Styles: TableOutputFormat,
fn table_to_string_with_format<'context, Styles>(
&'data self,
styles: &'context Styles,
) -> Stringwhere
Styles: TableOutputFormat,
Converts the table to a string representation specifying printer.
§Returns
A String
containing the formatted table.
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§
impl<'data, T, RowKey, Row, CellKey> TableFormatter<'data> for AsTable<'data, T, RowKey, Row, CellKey>
A trait for formatting tables.