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 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 fn filled(c: T) -> Self
pub 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.
Trait Implementations§
source§impl<T: Ord> Ord for Border<T>
impl<T: Ord> Ord for Border<T>
source§impl<T: PartialEq> PartialEq for Border<T>
impl<T: PartialEq> PartialEq for Border<T>
source§impl<T: PartialOrd> PartialOrd for Border<T>
impl<T: PartialOrd> PartialOrd for Border<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy> Copy for Border<T>
impl<T: Eq> Eq for Border<T>
impl<T> StructuralPartialEq for Border<T>
Auto Trait Implementations§
impl<T> Freeze for Border<T>where
T: Freeze,
impl<T> RefUnwindSafe for Border<T>where
T: RefUnwindSafe,
impl<T> Send for Border<T>where
T: Send,
impl<T> Sync for Border<T>where
T: Sync,
impl<T> Unpin for Border<T>where
T: Unpin,
impl<T> UnwindSafe for Border<T>where
T: UnwindSafe,
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: 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
)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
)