pub struct TableOptions {
pub columns: Option<Vec<String>>,
pub headers: HashMap<String, String>,
pub justify: HashMap<String, Justify>,
pub title: Option<String>,
pub max_rows: Option<usize>,
pub max_string: Option<usize>,
}Expand description
Overrides for a TableView.
Fields§
§columns: Option<Vec<String>>Show only these columns, in this order.
headers: HashMap<String, String>Header text per column key (default: the key).
justify: HashMap<String, Justify>Justification per column key (default: right for all-number columns, left otherwise).
title: Option<String>A title above the table (plain text, not markup).
max_rows: Option<usize>Show at most this many rows, then … N more.
max_string: Option<usize>Cut strings (and inline nested values) to this many characters.
Implementations§
Source§impl TableOptions
impl TableOptions
pub fn new() -> Self
Sourcepub fn columns<S: Into<String>>(
self,
columns: impl IntoIterator<Item = S>,
) -> Self
pub fn columns<S: Into<String>>( self, columns: impl IntoIterator<Item = S>, ) -> Self
Select and order the columns.
Sourcepub fn header(
self,
column: impl Into<String>,
header: impl Into<String>,
) -> Self
pub fn header( self, column: impl Into<String>, header: impl Into<String>, ) -> Self
Rename a column’s header.
pub fn title(self, title: impl Into<String>) -> Self
pub fn max_rows(self, max_rows: usize) -> Self
pub fn max_string(self, max_string: usize) -> Self
Trait Implementations§
Source§impl Clone for TableOptions
impl Clone for TableOptions
Source§impl Debug for TableOptions
impl Debug for TableOptions
Auto Trait Implementations§
impl Freeze for TableOptions
impl RefUnwindSafe for TableOptions
impl Send for TableOptions
impl Sync for TableOptions
impl Unpin for TableOptions
impl UnsafeUnpin for TableOptions
impl UnwindSafe for TableOptions
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