pub struct TableFormat { /* private fields */ }Expand description
Contains the table formatting rules
Implementations§
Source§impl TableFormat
impl TableFormat
Sourcepub fn new() -> TableFormat
pub fn new() -> TableFormat
Create a new empty TableFormat.
Sourcepub fn get_padding(&self) -> (usize, usize)
pub fn get_padding(&self) -> (usize, usize)
Return a tuple with left and right padding
Sourcepub fn column_separator(&mut self, separator: char)
pub fn column_separator(&mut self, separator: char)
Set the character used for internal column separation
Sourcepub fn left_border(&mut self, border: char)
pub fn left_border(&mut self, border: char)
Set the character used for left table border
Sourcepub fn right_border(&mut self, border: char)
pub fn right_border(&mut self, border: char)
Set the character used for right table border
Sourcepub fn separator(&mut self, what: LinePosition, separator: LineSeparator)
pub fn separator(&mut self, what: LinePosition, separator: LineSeparator)
Set a line separator
Sourcepub fn separators(&mut self, what: &[LinePosition], separator: LineSeparator)
pub fn separators(&mut self, what: &[LinePosition], separator: LineSeparator)
Set format for multiple kind of line separator
Sourcepub fn indent(&mut self, spaces: usize)
pub fn indent(&mut self, spaces: usize)
Set global indentation in spaces used when rendering a table
Sourcepub fn get_indent(&self) -> usize
pub fn get_indent(&self) -> usize
Get global indentation in spaces used when rendering a table
Sourcepub fn print_line_separator<T: Write + ?Sized>(
&self,
out: &mut T,
col_width: &[usize],
pos: LinePosition,
) -> Result<usize, Error>
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn print_line_separator<T: Write + ?Sized>( &self, out: &mut T, col_width: &[usize], pos: LinePosition, ) -> Result<usize, Error>
Will become private in future release. See issue #87
Print a full line separator to out. col_width is a slice containing the width of each column.
Returns the number of printed lines
Sourcepub fn get_column_separator(&self, pos: ColumnPosition) -> Option<char>
pub fn get_column_separator(&self, pos: ColumnPosition) -> Option<char>
Returns the character used to separate columns.
pos specify if the separator is left/right final or internal to the table
Sourcepub fn print_column_separator<T: Write + ?Sized>(
&self,
out: &mut T,
pos: ColumnPosition,
) -> Result<(), Error>
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn print_column_separator<T: Write + ?Sized>( &self, out: &mut T, pos: ColumnPosition, ) -> Result<(), Error>
Will become private in future release. See issue #87
Print a column separator or a table border
Trait Implementations§
Source§impl Clone for TableFormat
impl Clone for TableFormat
Source§fn clone(&self) -> TableFormat
fn clone(&self) -> TableFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more