pub trait Format {
// Required method
fn format(&self, data: &TableView) -> Result<String, FormatError>;
}Expand description
Unified formatting interface for all output formats
All formatters (table, json, yaml, text, etc.) implement this trait
to provide a consistent interface for formatting TableView data.
§Examples
use tree_fmt::{ RowBuilder, TableFormatter, TableConfig, Format };
let view = RowBuilder::new( vec![ "Name".into(), "Age".into() ] )
.add_row( vec![ "Alice".into(), "30".into() ] )
.build_view();
let formatter = TableFormatter::with_config( TableConfig::plain() );
let output = Format::format( &formatter, &view ).unwrap();
assert!( output.contains( "Name" ) );