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 table = Table::new(&data)
.with(Style::ascii())
.modify(Rows::single(0), Border::new().set_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 set_bottom(self, c: char) -> Border<T, On, L, R>
pub const fn set_bottom(self, c: char) -> Border<T, On, L, R>
Set a bottom border character.
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 set_corner_top_left(self, c: char) -> Self
pub const fn set_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 set_corner_top_right(self, c: char) -> Self
pub const fn set_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,
Available on crate feature std only.
impl<T, B, L, R, Data> CellOption<Data, ColoredConfig> for Border<T, B, L, R>where
Data: Records + ExactRecords,
Available on crate feature
std only.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>
impl<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)