pub struct Border<T, B, L, R> { /* private fields */ }
Expand description
Border represents a border 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
let mut table = Table::new(&data);
table.with(Style::ascii());
table.modify(Rows::one(0), Border::new().top('x'));
Implementations§
Source§impl Border<On, On, On, On>
impl Border<On, On, On, On>
Sourcepub const fn full(
top: char,
bottom: char,
left: char,
right: char,
top_left: char,
top_right: char,
bottom_left: char,
bottom_right: char,
) -> Self
pub const fn full( top: char, bottom: char, left: char, right: char, top_left: char, top_right: char, bottom_left: char, bottom_right: char, ) -> Self
This function constructs a cell borders with all sides set.
Sourcepub const fn filled(c: char) -> Self
pub const fn filled(c: char) -> 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.
Source§impl<T, B, L, R> Border<T, B, L, R>
impl<T, B, L, R> Border<T, B, L, R>
Sourcepub const fn into_inner(self) -> GridBorder<char>
pub const fn into_inner(self) -> GridBorder<char>
Converts a border into a general data structure.
Source§impl<T, L, R> Border<T, On, L, R>
impl<T, L, R> Border<T, On, L, R>
Sourcepub const fn get_bottom(&self) -> char
pub const fn get_bottom(&self) -> char
Get a bottom character.
Source§impl<B, R> Border<On, B, On, R>
impl<B, R> Border<On, B, On, R>
Sourcepub const fn corner_top_left(self, c: char) -> Self
pub const fn corner_top_left(self, c: char) -> Self
Set a top left intersection character.
Sourcepub const fn get_corner_top_left(&self) -> char
pub const fn get_corner_top_left(&self) -> char
Get a top left intersection character.
Source§impl<B, L> Border<On, B, L, On>
impl<B, L> Border<On, B, L, On>
Sourcepub const fn corner_top_right(self, c: char) -> Self
pub const fn corner_top_right(self, c: char) -> Self
Set a top right intersection character.
Sourcepub const fn get_corner_top_right(&self) -> char
pub const fn get_corner_top_right(&self) -> char
Get a top right intersection character.
Trait Implementations§
Source§impl<T, B, L, R, Data> CellOption<Data, ColoredConfig> for Border<T, B, L, R>where
Data: Records + ExactRecords,
impl<T, B, L, R, Data> CellOption<Data, ColoredConfig> for Border<T, B, L, R>where
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<T: Ord, B: Ord, L: Ord, R: Ord> Ord for Border<T, B, L, R>
impl<T: Ord, B: Ord, L: Ord, R: Ord> Ord for Border<T, B, L, R>
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<T: PartialEq, B: PartialEq, L: PartialEq, R: PartialEq> PartialEq for Border<T, B, L, R>
impl<T: PartialEq, B: PartialEq, L: PartialEq, R: PartialEq> PartialEq for Border<T, B, L, R>
Source§impl<T: PartialOrd, B: PartialOrd, L: PartialOrd, R: PartialOrd> PartialOrd for Border<T, B, L, R>
impl<T: PartialOrd, B: PartialOrd, L: PartialOrd, R: PartialOrd> PartialOrd for Border<T, B, L, R>
Source§impl<T, B, L, R, Data, D> TableOption<Data, ColoredConfig, D> for Border<T, B, L, R>where
Data: Records + ExactRecords,
impl<T, B, L, R, Data, D> TableOption<Data, ColoredConfig, D> for Border<T, B, L, R>where
Data: Records + ExactRecords,
Source§fn change(self, records: &mut Data, cfg: &mut ColoredConfig, dims: &mut D)
fn change(self, records: &mut Data, cfg: &mut ColoredConfig, dims: &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<T: Copy, B: Copy, L: Copy, R: Copy> Copy for Border<T, B, L, R>
impl<T: Eq, B: Eq, L: Eq, R: Eq> Eq for Border<T, B, L, R>
impl<T, B, L, R> StructuralPartialEq for Border<T, B, L, R>
Auto Trait Implementations§
impl<T, B, L, R> Freeze for Border<T, B, L, R>
impl<T, B, L, R> RefUnwindSafe for Border<T, B, L, R>
impl<T, B, L, R> Send for Border<T, B, L, R>
impl<T, B, L, R> Sync for Border<T, B, L, R>
impl<T, B, L, R> Unpin for Border<T, B, L, R>
impl<T, B, L, R> UnwindSafe for Border<T, B, L, R>
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