Skip to main content

banner/style/
border_glyphs.rs

1const DEFAULT_TOP_LEFT_CHAR: char = '┌';
2const DEFAULT_TOP_RIGHT_CHAR: char = '┐';
3const DEFAULT_BOTTOM_LEFT_CHAR: char = '└';
4const DEFAULT_BOTTOM_RIGHT_CHAR: char = '┘';
5const DEFAULT_TOP_CHAR: char = '─';
6const DEFAULT_LEFT_CHAR: char = '│';
7const DEFAULT_RIGHT_CHAR: char = '│';
8const DEFAULT_BOTTOM_CHAR: char = '─';
9
10/**
11 * Describes the glyphs used to render a border.
12 */
13pub struct BorderGlyphs {
14    pub top_left: char,
15    pub top_right: char,
16    pub bottom_left: char,
17    pub bottom_right: char,
18    pub top: char,
19    pub left: char,
20    pub right: char,
21    pub bottom: char,
22}
23
24
25impl BorderGlyphs {
26    /**
27     * Creates a new border glyphs descriptor with default values.
28     */
29    pub fn new() -> BorderGlyphs {
30        return BorderGlyphs {
31            top_left: DEFAULT_TOP_LEFT_CHAR,
32            top_right: DEFAULT_TOP_RIGHT_CHAR,
33            bottom_left: DEFAULT_BOTTOM_LEFT_CHAR,
34            bottom_right: DEFAULT_BOTTOM_RIGHT_CHAR,
35            top: DEFAULT_TOP_CHAR,
36            left: DEFAULT_LEFT_CHAR,
37            right: DEFAULT_RIGHT_CHAR,
38            bottom: DEFAULT_BOTTOM_CHAR,
39        };
40    }
41}