pub struct Columns<'a> {
pub header: Vec<&'a str>,
pub rows: Vec<Vec<String>>,
}Available on crate feature
terminal only.Expand description
A list printed as borderless aligned columns.
Cells are padded to the widest cell of their column, measured in
terminal display columns, and separated by two spaces; the last column
is not padded. An empty or missing cell prints as -, and a line break
inside a cell as a space. Nothing is truncated: the terminal folds a
long line. Labels and cells print as given: the caller passes the
labels uppercase, and sanitizes an untrusted cell first with
sanitize::text.
Fields§
§header: Vec<&'a str>The column labels, printed as the header row unless empty.
rows: Vec<Vec<String>>The rendered cells of each row, in print order.
Implementations§
Trait Implementations§
impl<'a> Eq for Columns<'a>
impl<'a> StructuralPartialEq for Columns<'a>
Auto Trait Implementations§
impl<'a> Forget for Columns<'a>
impl<'a> Freeze for Columns<'a>
impl<'a> Move for Columns<'a>
impl<'a> RefUnwindSafe for Columns<'a>
impl<'a> Send for Columns<'a>
impl<'a> Sync for Columns<'a>
impl<'a> Unpin for Columns<'a>
impl<'a> UnsafeUnpin for Columns<'a>
impl<'a> UnwindSafe for Columns<'a>
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