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>,
) -> Border<T>
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>, ) -> Border<T>
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,
) -> Border<T>
pub const fn full( top: T, bottom: T, left: T, right: T, top_left: T, top_right: T, bottom_left: T, bottom_right: T, ) -> Border<T>
This function constructs a cell borders with all sides set.
Sourcepub const fn empty() -> Border<T>
pub const fn empty() -> Border<T>
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> Border<T>where
T: Copy,
impl<T> Border<T>where
T: Copy,
Sourcepub const fn filled(c: T) -> Border<T>
pub const fn filled(c: T) -> Border<T>
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.
Trait Implementations§
Source§impl<R> CellOption<R, ColoredConfig> for Border<char>where
R: Records + ExactRecords,
impl<R> CellOption<R, ColoredConfig> for Border<char>where
R: Records + ExactRecords,
Source§fn change(self, records: &mut R, cfg: &mut ColoredConfig, entity: Entity)
fn change(self, records: &mut R, cfg: &mut ColoredConfig, entity: Entity)
Entity
.Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
TableOption
is going to change table layout. Read moreSource§impl From<BorderColor> for Border<Color>
impl From<BorderColor> for Border<Color>
Source§fn from(value: BorderColor) -> Self
fn from(value: BorderColor) -> Self
Source§impl<T> Ord for Border<T>where
T: Ord,
impl<T> Ord for Border<T>where
T: Ord,
Source§impl<T> PartialOrd for Border<T>where
T: PartialOrd,
impl<T> PartialOrd for Border<T>where
T: PartialOrd,
Source§impl<R, D> TableOption<R, ColoredConfig, D> for Border<char>
impl<R, D> TableOption<R, ColoredConfig, D> for Border<char>
Source§fn change(self, _: &mut R, cfg: &mut ColoredConfig, _: &mut D)
fn change(self, _: &mut R, cfg: &mut ColoredConfig, _: &mut D)
Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
TableOption
is going to change table layout. Read more