1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
use tabled::style::{Line, RawStyle, Style};
#[derive(Debug, Clone)]
pub struct TableTheme {
pub(crate) theme: RawStyle,
}
impl TableTheme {
pub fn basic() -> TableTheme {
Self {
theme: Style::ascii().into(),
}
}
pub fn thin() -> TableTheme {
Self {
theme: Style::modern().into(),
}
}
pub fn light() -> TableTheme {
Self {
theme: Style::blank()
.lines([(1, Line::new(Some('─'), Some('─'), None, None))])
.into(),
}
}
pub fn compact() -> TableTheme {
Self {
theme: Style::modern()
.off_left()
.off_right()
.off_horizontal()
.lines([(1, Style::modern().get_horizontal().left(None).right(None))])
.into(),
}
}
pub fn with_love() -> TableTheme {
Self {
theme: Style::empty()
.top('❤')
.bottom('❤')
.vertical('❤')
.lines([(1, Line::new(Some('❤'), Some('❤'), None, None))])
.into(),
}
}
pub fn compact_double() -> TableTheme {
Self {
theme: Style::extended()
.off_left()
.off_right()
.off_horizontal()
.lines([(1, Style::extended().get_horizontal().left(None).right(None))])
.into(),
}
}
pub fn rounded() -> TableTheme {
Self {
theme: Style::rounded().into(),
}
}
pub fn reinforced() -> TableTheme {
Self {
theme: Style::modern()
.top_left_corner('┏')
.top_right_corner('┓')
.bottom_left_corner('┗')
.bottom_right_corner('┛')
.off_horizontal()
.into(),
}
}
pub fn heavy() -> TableTheme {
Self {
theme: Style::empty()
.top('━')
.bottom('━')
.vertical('┃')
.left('┃')
.right('┃')
.top_intersection('┳')
.bottom_intersection('┻')
.top_left_corner('┏')
.top_right_corner('┓')
.bottom_left_corner('┗')
.bottom_right_corner('┛')
.lines([(1, Line::full('━', '╋', '┣', '┫'))])
.into(),
}
}
pub fn none() -> TableTheme {
Self {
theme: Style::blank().into(),
}
}
}