Skip to main content

BoxStyle

Struct BoxStyle 

Source
pub struct BoxStyle {
Show 33 fields pub top_left: char, pub top: char, pub top_divider: char, pub top_right: char, pub head_left: char, pub head_horizontal: 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_horizontal: 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_horizontal: char, pub foot_vertical: char, pub foot_right: char, pub bottom_left: char, pub bottom: char, pub bottom_divider: char, pub bottom_right: char, pub ascii: bool,
}
Expand description

A set of box-drawing characters defining the look of borders.

Layout of the 8-line string that defines a box:

┌─┬┐ top
│ ││ head
├─┼┤ head_row
│ ││ mid
├─┼┤ row
├─┼┤ foot_row
│ ││ foot
└─┴┘ bottom

Fields§

§top_left: char§top: char§top_divider: char§top_right: char§head_left: char§head_horizontal: 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_horizontal: 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_horizontal: char§foot_vertical: char§foot_right: char§bottom_left: char§bottom: char§bottom_divider: char§bottom_right: char§ascii: bool

True if this box uses only ASCII characters.

Implementations§

Source§

impl BoxStyle

Source

pub fn from_str(box_str: &str, ascii: bool) -> Self

Parse a box style from an 8-line string.

Source

pub fn to_string(&self) -> String

Get the plain text representation of the box definition.

Trait Implementations§

Source§

impl Clone for BoxStyle

Source§

fn clone(&self) -> BoxStyle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BoxStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for BoxStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BoxStyle

Source§

fn eq(&self, other: &BoxStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for BoxStyle

Source§

impl StructuralPartialEq for BoxStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.