Struct term_table::TableStyle

source ·
pub struct TableStyle {
    pub top_left_corner: char,
    pub top_right_corner: char,
    pub bottom_left_corner: char,
    pub bottom_right_corner: char,
    pub outer_left_vertical: char,
    pub outer_right_vertical: char,
    pub outer_bottom_horizontal: char,
    pub outer_top_horizontal: char,
    pub intersection: char,
    pub vertical: char,
    pub horizontal: char,
}
Expand description

A set of characters which make up a table style

§Example

 term_table::TableStyle {
     top_left_corner: '╔',
     top_right_corner: '╗',
     bottom_left_corner: '╚',
     bottom_right_corner: '╝',
     outer_left_vertical: '╠',
     outer_right_vertical: '╣',
     outer_bottom_horizontal: '╩',
     outer_top_horizontal: '╦',
     intersection: '╬',
     vertical: '║',
     horizontal: '═',
 };

Fields§

§top_left_corner: char§top_right_corner: char§bottom_left_corner: char§bottom_right_corner: char§outer_left_vertical: char§outer_right_vertical: char§outer_bottom_horizontal: char§outer_top_horizontal: char§intersection: char§vertical: char§horizontal: char

Implementations§

source§

impl TableStyle

source

pub fn simple() -> TableStyle

Basic terminal table style

§Example
   +---------------------------------------------------------------------------------+
   |                            This is some centered text                           |
   +----------------------------------------+----------------------------------------+
   | This is left aligned text              |             This is right aligned text |
   +----------------------------------------+----------------------------------------+
   | This is left aligned text              |             This is right aligned text |
   +----------------------------------------+----------------------------------------+
   | This is some really really really really really really really really really tha |
   | t is going to wrap to the next line                                             |
   +---------------------------------------------------------------------------------+
source

pub fn extended() -> TableStyle

Table style using extended character set

§Example
 ╔═════════════════════════════════════════════════════════════════════════════════╗
 ║                            This is some centered text                           ║
 ╠════════════════════════════════════════╦════════════════════════════════════════╣
 ║ This is left aligned text              ║             This is right aligned text ║
 ╠════════════════════════════════════════╬════════════════════════════════════════╣
 ║ This is left aligned text              ║             This is right aligned text ║
 ╠════════════════════════════════════════╩════════════════════════════════════════╣
 ║ This is some really really really really really really really really really tha ║
 ║ t is going to wrap to the next line                                             ║
 ╚═════════════════════════════════════════════════════════════════════════════════╝
source

pub fn thin() -> TableStyle

┌─────────────────────────────────────────────────────────────────────────────────┐
│                            This is some centered text                           │
├────────────────────────────────────────┬────────────────────────────────────────┤
│ This is left aligned text              │             This is right aligned text │
├────────────────────────────────────────┼────────────────────────────────────────┤
│ This is left aligned text              │             This is right aligned text │
├────────────────────────────────────────┴────────────────────────────────────────┤
│ This is some really really really really really really really really really tha │
│ t is going to wrap to the next line                                             │
└─────────────────────────────────────────────────────────────────────────────────┘
source

pub fn rounded() -> TableStyle

╭─────────────────────────────────────────────────────────────────────────────────╮
│                            This is some centered text                           │
├────────────────────────────────────────┬────────────────────────────────────────┤
│ This is left aligned text              │             This is right aligned text │
├────────────────────────────────────────┼────────────────────────────────────────┤
│ This is left aligned text              │             This is right aligned text │
├────────────────────────────────────────┴────────────────────────────────────────┤
│ This is some really really really really really really really really really tha │
│ t is going to wrap to the next line                                             │
╰─────────────────────────────────────────────────────────────────────────────────╯
source

pub fn elegant() -> TableStyle

╔─────────────────────────────────────────────────────────────────────────────────╗
│                            This is some centered text                           │
╠────────────────────────────────────────╦────────────────────────────────────────╣
│ This is left aligned text              │             This is right aligned text │
╠────────────────────────────────────────┼────────────────────────────────────────╣
│ This is left aligned text              │             This is right aligned text │
╠────────────────────────────────────────╩────────────────────────────────────────╣
│ This is some really really really really really really really really really tha │
│ t is going to wrap to the next line                                             │
╚─────────────────────────────────────────────────────────────────────────────────╝
source

pub fn blank() -> TableStyle

Table style comprised of null characters

§Example
                           This is some centered text

 This is left aligned text                           This is right aligned text

 This is left aligned text                           This is right aligned text

 This is some really really really really really really really really really tha
 t is going to wrap to the next line
source

pub fn empty() -> TableStyle

Table style comprised of empty characters for compatibility with terminals that don’t handle null characters appropriately

§Example
                           This is some centered text

 This is left aligned text                           This is right aligned text

 This is left aligned text                           This is right aligned text

 This is some really really really really really really really really really tha
 t is going to wrap to the next line

Trait Implementations§

source§

impl Clone for TableStyle

source§

fn clone(&self) -> TableStyle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TableStyle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for TableStyle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.