pub struct Box {Show 29 fields
pub top_left: char,
pub top: char,
pub top_divider: char,
pub top_right: char,
pub head_left: char,
pub head_vertical: char,
pub head_right: char,
pub head_row_left: char,
pub head_row_horizontal: char,
pub head_row_cross: char,
pub head_row_right: char,
pub mid_left: char,
pub mid_vertical: char,
pub mid_right: char,
pub row_left: char,
pub row_horizontal: char,
pub row_cross: char,
pub row_right: char,
pub foot_row_left: char,
pub foot_row_horizontal: char,
pub foot_row_cross: char,
pub foot_row_right: char,
pub foot_left: char,
pub foot_vertical: char,
pub foot_right: char,
pub bottom_left: char,
pub bottom: char,
pub bottom_divider: char,
pub bottom_right: char,
}Expand description
A set of box-drawing characters. Mirrors rich.box.Box.
The field names match upstream’s 8×4 grid:
top_left top top_divider top_right
head_left (space) head_vertical head_right
head_row_left head_row_horizontal head_row_cross head_row_right
mid_left (space) mid_vertical mid_right
row_left row_horizontal row_cross row_right
foot_row_left foot_row_horizontal foot_row_cross foot_row_right
foot_left (space) foot_vertical foot_right
bottom_left bottom bottom_divider bottom_rightFields§
§top_left: char§top: char§top_divider: char§top_right: char§head_left: char§head_vertical: char§head_right: char§head_row_left: char§head_row_horizontal: char§head_row_cross: char§head_row_right: char§mid_left: char§mid_vertical: char§mid_right: char§row_left: char§row_horizontal: char§row_cross: char§row_right: char§foot_row_left: char§foot_row_horizontal: char§foot_row_cross: char§foot_row_right: char§foot_left: char§foot_vertical: char§foot_right: char§bottom_left: char§bottom: char§bottom_divider: char§bottom_right: charImplementations§
Source§impl Box
impl Box
Sourcepub fn get_top(&self, widths: &[usize], edge: bool) -> String
pub fn get_top(&self, widths: &[usize], edge: bool) -> String
The top border for the given column widths. Port of Box.get_top.
edge controls whether the left/right corner glyphs are drawn.
Sourcepub fn get_row(&self, widths: &[usize], level: RowLevel, edge: bool) -> String
pub fn get_row(&self, widths: &[usize], level: RowLevel, edge: bool) -> String
A horizontal divider row between columns at a given level. Port of
Box.get_row. edge controls whether the left/right glyphs are drawn.
Sourcepub fn substitute(
&self,
legacy_windows: bool,
safe: bool,
ascii_only: bool,
) -> Box
pub fn substitute( &self, legacy_windows: bool, safe: bool, ascii_only: bool, ) -> Box
Return a version of this box safe for the target terminal. Port of
Box.substitute.
On a legacy Windows console (legacy_windows + safe), the fancy boxes
that legacy code pages can’t draw — ROUNDED, HEAVY, HEAVY_HEAD —
fall back to SQUARE (DOUBLE/SQUARE/MINIMAL are kept). On a
non-UTF-8 terminal (ascii_only), any non-ASCII box becomes ASCII.
Sourcepub fn get_bottom(&self, widths: &[usize], edge: bool) -> String
pub fn get_bottom(&self, widths: &[usize], edge: bool) -> String
The bottom border for the given column widths. Port of Box.get_bottom.
edge controls whether the left/right corner glyphs are drawn.
Trait Implementations§
impl Copy for Box
impl Eq for Box
impl StructuralPartialEq for Box
Auto Trait Implementations§
impl Freeze for Box
impl RefUnwindSafe for Box
impl Send for Box
impl Sync for Box
impl Unpin for Box
impl UnsafeUnpin for Box
impl UnwindSafe for Box
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.