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
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
pub struct Sides<T> {
pub top: T,
pub bottom: T,
pub left: T,
pub right: T,
}
impl<T> Sides<T> {
pub fn new(left: T, right: T, top: T, bottom: T) -> Self {
Self {
top,
bottom,
left,
right,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Indent {
pub fill: char,
pub size: usize,
}
impl Indent {
pub fn new(size: usize, fill: char) -> Self {
Self { fill, size }
}
pub fn spaced(size: usize) -> Self {
Self { size, fill: ' ' }
}
}
impl Default for Indent {
fn default() -> Self {
Self { size: 0, fill: ' ' }
}
}