#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Box {
pub top: Line,
pub head: Line,
pub mid: Line,
pub bottom: Line,
pub header: Line,
pub cell: Line,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Line {
pub left: char,
pub mid: char,
pub right: char,
pub cross: char,
}
impl Line {
pub const fn new(left: char, mid: char, right: char, cross: char) -> Self {
Self {
left,
mid,
right,
cross,
}
}
}
pub const ASCII: Box = Box {
top: Line::new('+', '-', '+', '+'),
head: Line::new('+', '-', '+', '+'),
mid: Line::new('+', '-', '+', '+'),
bottom: Line::new('+', '-', '+', '+'),
header: Line::new('|', ' ', '|', '|'),
cell: Line::new('|', ' ', '|', '|'),
};
pub const ASCII_DOUBLE_HEAD: Box = Box {
top: Line::new('+', '-', '+', '+'),
head: Line::new('+', '=', '+', '+'),
mid: Line::new('+', '-', '+', '+'),
bottom: Line::new('+', '-', '+', '+'),
header: Line::new('|', ' ', '|', '|'),
cell: Line::new('|', ' ', '|', '|'),
};
pub const SQUARE: Box = Box {
top: Line::new('┌', '─', '┐', '┬'),
head: Line::new('├', '─', '┤', '┼'),
mid: Line::new('├', '─', '┤', '┼'),
bottom: Line::new('└', '─', '┘', '┴'),
header: Line::new('│', ' ', '│', '│'),
cell: Line::new('│', ' ', '│', '│'),
};
pub const SQUARE_DOUBLE_HEAD: Box = Box {
top: Line::new('┌', '─', '┐', '┬'),
head: Line::new('╞', '═', '╡', '╪'),
mid: Line::new('├', '─', '┤', '┼'),
bottom: Line::new('└', '─', '┘', '┴'),
header: Line::new('│', ' ', '│', '│'),
cell: Line::new('│', ' ', '│', '│'),
};
pub const MINIMAL: Box = Box {
top: Line::new(' ', '─', ' ', '─'),
head: Line::new(' ', '─', ' ', '─'),
mid: Line::new(' ', '─', ' ', '─'),
bottom: Line::new(' ', '─', ' ', '─'),
header: Line::new(' ', ' ', ' ', ' '),
cell: Line::new(' ', ' ', ' ', ' '),
};
pub const MINIMAL_HEAVY_HEAD: Box = Box {
top: Line::new(' ', '─', ' ', '─'),
head: Line::new(' ', '━', ' ', '━'),
mid: Line::new(' ', '─', ' ', '─'),
bottom: Line::new(' ', '─', ' ', '─'),
header: Line::new(' ', ' ', ' ', ' '),
cell: Line::new(' ', ' ', ' ', ' '),
};
pub const MINIMAL_DOUBLE_HEAD: Box = Box {
top: Line::new(' ', '─', ' ', '─'),
head: Line::new(' ', '═', ' ', '═'),
mid: Line::new(' ', '─', ' ', '─'),
bottom: Line::new(' ', '─', ' ', '─'),
header: Line::new(' ', ' ', ' ', ' '),
cell: Line::new(' ', ' ', ' ', ' '),
};
pub const HORIZONTALS: Box = Box {
top: Line::new(' ', '─', ' ', '─'),
head: Line::new(' ', '─', ' ', '─'),
mid: Line::new(' ', '─', ' ', '─'),
bottom: Line::new(' ', '─', ' ', '─'),
header: Line::new(' ', ' ', ' ', ' '),
cell: Line::new(' ', ' ', ' ', ' '),
};
pub const ROUNDED: Box = Box {
top: Line::new('╭', '─', '╮', '┬'),
head: Line::new('├', '─', '┤', '┼'),
mid: Line::new('├', '─', '┤', '┼'),
bottom: Line::new('╰', '─', '╯', '┴'),
header: Line::new('│', ' ', '│', '│'),
cell: Line::new('│', ' ', '│', '│'),
};
pub const HEAVY: Box = Box {
top: Line::new('┏', '━', '┓', '┳'),
head: Line::new('┣', '━', '┫', '╋'),
mid: Line::new('┣', '━', '┫', '╋'),
bottom: Line::new('┗', '━', '┛', '┻'),
header: Line::new('┃', ' ', '┃', '┃'),
cell: Line::new('┃', ' ', '┃', '┃'),
};
pub const HEAVY_EDGE: Box = Box {
top: Line::new('┏', '━', '┓', '┳'),
head: Line::new('┣', '━', '┫', '╇'),
mid: Line::new('┣', '━', '┫', '╇'),
bottom: Line::new('┗', '━', '┛', '┻'),
header: Line::new('┃', ' ', '┃', '┃'),
cell: Line::new('┃', ' ', '┃', '┃'),
};
pub const HEAVY_HEAD: Box = Box {
top: Line::new('┏', '━', '┓', '┳'),
head: Line::new('┡', '━', '┩', '╇'),
mid: Line::new('│', '─', '│', '┼'),
bottom: Line::new('└', '─', '┘', '┴'),
header: Line::new('┃', ' ', '┃', '┃'),
cell: Line::new('│', ' ', '│', '│'),
};
pub const DOUBLE: Box = Box {
top: Line::new('╔', '═', '╗', '╦'),
head: Line::new('╠', '═', '╣', '╬'),
mid: Line::new('╠', '═', '╣', '╬'),
bottom: Line::new('╚', '═', '╝', '╩'),
header: Line::new('║', ' ', '║', '║'),
cell: Line::new('║', ' ', '║', '║'),
};
pub const DOUBLE_EDGE: Box = Box {
top: Line::new('╔', '═', '╗', '╤'),
head: Line::new('╠', '═', '╣', '╪'),
mid: Line::new('╟', '─', '╢', '┼'),
bottom: Line::new('╚', '═', '╝', '╧'),
header: Line::new('║', ' ', '║', '║'),
cell: Line::new('║', ' ', '║', '║'),
};