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>
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>
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
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TableFormat
impl Debug for TableFormat
Source§impl Default for TableFormat
impl Default for TableFormat
Source§impl From<TableFormat> for FormatBuilder
impl From<TableFormat> for FormatBuilder
Source§fn from(fmt: TableFormat) -> Self
fn from(fmt: TableFormat) -> Self
Converts to this type from the input type.
Source§impl Hash for TableFormat
impl Hash for TableFormat
Source§impl Into<TableFormat> for FormatBuilder
impl Into<TableFormat> for FormatBuilder
Source§fn into(self) -> TableFormat
fn into(self) -> TableFormat
Converts this type into the (usually inferred) input type.
Source§impl PartialEq for TableFormat
impl PartialEq for TableFormat
impl Copy for TableFormat
impl Eq for TableFormat
impl StructuralPartialEq for TableFormat
Auto Trait Implementations§
impl Freeze for TableFormat
impl RefUnwindSafe for TableFormat
impl Send for TableFormat
impl Sync for TableFormat
impl Unpin for TableFormat
impl UnwindSafe for TableFormat
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)