pub struct Table<'data> {
pub has_separate_rows: bool,
pub has_top_border: bool,
pub has_bottom_border: bool,
/* private fields */
}
Expand description
A set of rows containing data
Fields§
§has_separate_rows: bool
Whether or not to vertically separate rows in the table.
Defaults to true
.
has_top_border: bool
Whether the table should have a top border.
Setting has_separator
to false on the first row will have the same effect as setting this
to false
Defaults to true
.
has_bottom_border: bool
Whether the table should have a bottom border
Defaults to true
.
Implementations§
Source§impl<'data> Table<'data>
impl<'data> Table<'data>
pub fn new() -> Table<'data>
pub fn from_rows(rows: Vec<Row<'data>>) -> Table<'data>
pub fn from_serde( data: impl IntoIterator<Item = impl Serialize>, ) -> Result<Self>
pub fn with_style(self, style: TableStyle) -> Self
pub fn set_style(&mut self, style: TableStyle) -> &mut Self
pub fn has_separate_rows(&self) -> bool
pub fn with_separate_rows(self, has_separate_rows: bool) -> Self
pub fn set_separate_rows(&mut self, has_separate_rows: bool) -> &mut Self
Sourcepub fn for_terminal(&self) -> impl Display + '_
pub fn for_terminal(&self) -> impl Display + '_
Get the terminal width and use this for the table width.
§Panics
Will panic if it cannot get the terminal width (e.g. because we aren’t in a terminal).
Sourcepub fn fixed_width(&self, width: usize) -> impl Display + '_
pub fn fixed_width(&self, width: usize) -> impl Display + '_
Use a custom value for the table width
Trait Implementations§
Auto Trait Implementations§
impl<'data> !Freeze for Table<'data>
impl<'data> !RefUnwindSafe for Table<'data>
impl<'data> Send for Table<'data>
impl<'data> !Sync for Table<'data>
impl<'data> Unpin for Table<'data>
impl<'data> UnwindSafe for Table<'data>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more