pub struct Stream<T, Out: Write> { /* private fields */ }Expand description
Allows printing rows of data to some io::Write.
Implementations§
Source§impl<T, Out: Write> Stream<T, Out>
impl<T, Out: Write> Stream<T, Out>
Sourcepub fn max_width(self, max_width: usize) -> Self
pub fn max_width(self, max_width: usize) -> Self
Set the maximum width for the table. Note: this may be increased automatically for you if you’ve specified columns, borders, dividers, and paddings with sizes that require a larger max_width.
Sourcepub fn padding(self, padding: bool) -> Self
pub fn padding(self, padding: bool) -> Self
Enable horizontal padding around | dividers and inside external borders. (default: true)
Sourcepub fn grow(self, grow: bool) -> Self
pub fn grow(self, grow: bool) -> Self
Should the table grow to fit its max_size?
Default behavior is determined by how much data we send to Stream.
- If we
.finish()before the buffer is full, and determine that the table can be rendered smaller, then we will do so. (grow=false) - If we fill the buffer and begin streaming mode, we’ll grow the table so that there will be spare width later if we need it. (grow=true)
Sourcepub fn title(self, title: &str) -> Self
pub fn title(self, title: &str) -> Self
Set a table title, to be displayed centered above the table.
Sourcepub fn row(&mut self, data: T) -> Result<()>
pub fn row(&mut self, data: T) -> Result<()>
Print a single row. Note: Stream may buffer some rows before it begins output to calculate column sizes.
Sourcepub fn finish(self) -> Result<()>
pub fn finish(self) -> Result<()>
Finish writing output. This may write any items still in the buffer, as well as a trailing horizontal line and footer.
Like [finish], but adds a footer at the end as well.