pub struct TableView {
pub metadata: TableMetadata,
pub rows: Vec<Vec<String>>,
}Expand description
Canonical table data structure for unified formatting
This is the universal data format that all formatters accept.
Build once using RowBuilder, then format to any output format.
§Examples
use tree_fmt::{ TableView, TableMetadata };
let view = TableView {
metadata: TableMetadata::new( vec![ "Name".into(), "Age".into() ] ),
rows: vec![
vec![ "Alice".into(), "30".into() ],
vec![ "Bob".into(), "25".into() ],
],
};
assert_eq!( view.metadata.column_names.len(), 2 );
assert_eq!( view.rows.len(), 2 );Fields§
§metadata: TableMetadataTable metadata (column names and types)
rows: Vec<Vec<String>>Table rows (data)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableView
impl RefUnwindSafe for TableView
impl Send for TableView
impl Sync for TableView
impl Unpin for TableView
impl UnwindSafe for TableView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more