pub struct BorderColor { /* private fields */ }
Expand description
Border represents a border color of a Cell.
top border
|
V
corner top left ------> +_______+ <---- corner top left
| |
left border ----------> | cell | <---- right border
| |
corner bottom right --> +_______+ <---- corner bottom right
^
|
bottom border
§Example
let mut table = Table::new(&data);
table.with(Style::ascii());
table.modify(Rows::one(0), BorderColor::new().top(Color::FG_RED));
Implementations§
Source§impl BorderColor
impl BorderColor
Sourcepub const fn full(
top: Color,
bottom: Color,
left: Color,
right: Color,
top_left: Color,
top_right: Color,
bottom_left: Color,
bottom_right: Color,
) -> Self
pub const fn full( top: Color, bottom: Color, left: Color, right: Color, top_left: Color, top_right: Color, bottom_left: Color, bottom_right: Color, ) -> Self
This function constructs a cell borders with all sides set.
Sourcepub fn filled(c: Color) -> Self
pub fn filled(c: Color) -> Self
This function constructs a cell borders with all sides’s char set to a given color.
It behaves like BorderColor::full
with the same color set to each side.
Sourcepub fn into_inner(self) -> GridBorder<Color>
pub fn into_inner(self) -> GridBorder<Color>
Converts a border into a general data structure.
Sourcepub fn corner_top_left(self, c: Color) -> Self
pub fn corner_top_left(self, c: Color) -> Self
Set a top left intersection color.
Sourcepub fn corner_top_right(self, c: Color) -> Self
pub fn corner_top_right(self, c: Color) -> Self
Set a top right intersection color.
Sourcepub fn corner_bottom_left(self, c: Color) -> Self
pub fn corner_bottom_left(self, c: Color) -> Self
Set a bottom left intersection color.
Sourcepub fn corner_bottom_right(self, c: Color) -> Self
pub fn corner_bottom_right(self, c: Color) -> Self
Set a bottom right intersection color.
Trait Implementations§
Source§impl<Data> CellOption<Data, ColoredConfig> for BorderColorwhere
Data: Records + ExactRecords,
impl<Data> CellOption<Data, ColoredConfig> for BorderColorwhere
Data: Records + ExactRecords,
Source§fn change(self, records: &mut Data, cfg: &mut ColoredConfig, entity: Entity)
fn change(self, records: &mut Data, cfg: &mut ColoredConfig, entity: Entity)
Modification function of a certail part of a grid targeted by
Entity
.Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
A hint whether an
TableOption
is going to change table layout. Read moreSource§impl Clone for BorderColor
impl Clone for BorderColor
Source§fn clone(&self) -> BorderColor
fn clone(&self) -> BorderColor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BorderColor
impl Debug for BorderColor
Source§impl Default for BorderColor
impl Default for BorderColor
Source§fn default() -> BorderColor
fn default() -> BorderColor
Returns the “default value” for a type. Read more
Source§impl From<BorderColor> for Border<Color>
impl From<BorderColor> for Border<Color>
Source§fn from(value: BorderColor) -> Self
fn from(value: BorderColor) -> Self
Converts to this type from the input type.
Source§impl Ord for BorderColor
impl Ord for BorderColor
Source§fn cmp(&self, other: &BorderColor) -> Ordering
fn cmp(&self, other: &BorderColor) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BorderColor
impl PartialEq for BorderColor
Source§impl PartialOrd for BorderColor
impl PartialOrd for BorderColor
Source§impl<Data, D> TableOption<Data, ColoredConfig, D> for BorderColorwhere
Data: Records + ExactRecords,
impl<Data, D> TableOption<Data, ColoredConfig, D> for BorderColorwhere
Data: Records + ExactRecords,
Source§fn change(self, records: &mut Data, cfg: &mut ColoredConfig, _: &mut D)
fn change(self, records: &mut Data, cfg: &mut ColoredConfig, _: &mut D)
The function modificaties of records and a grid configuration.
Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
A hint whether an
TableOption
is going to change table layout. Read moreimpl Eq for BorderColor
impl StructuralPartialEq for BorderColor
Auto Trait Implementations§
impl Freeze for BorderColor
impl RefUnwindSafe for BorderColor
impl Send for BorderColor
impl Sync for BorderColor
impl Unpin for BorderColor
impl UnwindSafe for BorderColor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more