pub struct Border<T> {
pub top: Option<T>,
pub bottom: Option<T>,
pub left: Option<T>,
pub right: Option<T>,
pub left_top_corner: Option<T>,
pub left_bottom_corner: Option<T>,
pub right_top_corner: Option<T>,
pub right_bottom_corner: Option<T>,
}
Expand description
Border is a representation of a cells’s borders (left, right, top, bottom, and the corners)
top border
|
V
corner top left ------> +_______+ <---- corner top left
| |
left border ----------> | cell | <---- right border
| |
corner bottom right --> +_______+ <---- corner bottom right
^
|
bottom border
Fields§
§top: Option<T>
A character for a top.
bottom: Option<T>
A character for a bottom.
left: Option<T>
A character for a left.
right: Option<T>
A character for a right.
left_top_corner: Option<T>
A character for a left top corner.
left_bottom_corner: Option<T>
A character for a left bottom corner.
right_top_corner: Option<T>
A character for a right top corner.
right_bottom_corner: Option<T>
A character for a right bottom corner.
Implementations§
Source§impl<T> Border<T>
impl<T> Border<T>
Sourcepub const fn new(
top: Option<T>,
bottom: Option<T>,
left: Option<T>,
right: Option<T>,
left_top_corner: Option<T>,
left_bottom_corner: Option<T>,
right_top_corner: Option<T>,
right_bottom_corner: Option<T>,
) -> Self
pub const fn new( top: Option<T>, bottom: Option<T>, left: Option<T>, right: Option<T>, left_top_corner: Option<T>, left_bottom_corner: Option<T>, right_top_corner: Option<T>, right_bottom_corner: Option<T>, ) -> Self
This function constructs a cell borders with all sides set.
Sourcepub const fn full(
top: T,
bottom: T,
left: T,
right: T,
top_left: T,
top_right: T,
bottom_left: T,
bottom_right: T,
) -> Self
pub const fn full( top: T, bottom: T, left: T, right: T, top_left: T, top_right: T, bottom_left: T, bottom_right: T, ) -> Self
This function constructs a cell borders with all sides set.
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
This function constructs a cell borders with all sides being empty (set off).
Sourcepub fn is_same(&self) -> boolwhere
T: PartialEq,
pub fn is_same(&self) -> boolwhere
T: PartialEq,
Checks whether all sides are equal to one another.
Sourcepub const fn has_bottom(&self) -> bool
pub const fn has_bottom(&self) -> bool
Verifies whether anything is set on the bottom.
Source§impl<T: Copy> Border<T>
impl<T: Copy> Border<T>
Sourcepub const fn filled(c: T) -> Self
pub const fn filled(c: T) -> Self
This function constructs a cell borders with all sides’s char set to a given character.
It behaves like Border::full
with the same character set to each side.