pub struct OutputTable { /* private fields */ }Expand description
A formatted table for terminal output.
Implementations§
Source§impl OutputTable
impl OutputTable
Sourcepub fn new(columns: Vec<impl Into<String>>) -> Self
pub fn new(columns: Vec<impl Into<String>>) -> Self
Create a table with the given column headings.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set a human-readable table title.
Sourcepub fn add_row(&mut self, row: Vec<impl Into<String>>)
pub fn add_row(&mut self, row: Vec<impl Into<String>>)
Append a row of cell values.
The row is normalized to the column count: extra cells are dropped and missing cells are padded with empty strings, so every rendered row lines up with the header and borders regardless of the caller’s cell count.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OutputTable
impl RefUnwindSafe for OutputTable
impl Send for OutputTable
impl Sync for OutputTable
impl Unpin for OutputTable
impl UnsafeUnpin for OutputTable
impl UnwindSafe for OutputTable
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