BoxStyle

Struct BoxStyle 

Source
pub struct BoxStyle {
    pub top_left: Cell,
    pub top_right: Cell,
    pub bottom_right: Cell,
    pub bottom_left: Cell,
    pub horizontal: Cell,
    pub vertical: Cell,
}
Expand description

Characters used to draw box borders.

Provides predefined styles like ASCII and LIGHT.

Fields§

§top_left: Cell

Top-left corner character.

§top_right: Cell

Top-right corner character.

§bottom_right: Cell

Bottom-right corner character.

§bottom_left: Cell

Bottom-left corner character.

§horizontal: Cell

Horizontal line character.

§vertical: Cell

Vertical line character.

Implementations§

Source§

impl BoxStyle

Source

pub const ASCII: BoxStyle

ASCII box drawing characters (+, -, |).

Source

pub const LIGHT: BoxStyle

Unicode light box drawing characters (, , , etc.).

Source§

impl BoxStyle

Source

pub fn render(&self, rect: Rect, buf: &mut DoubleBuffer) -> Rect

Renders a complete box border within the given rectangle.

Returns the inner rectangle after subtracting the border.

Source

pub fn render_partial( &self, rect: Rect, buf: &mut DoubleBuffer, set: RelSet, ) -> Rect

Renders only the specified parts of a box border.

Returns the inner rectangle after subtracting the rendered edges.

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> 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, 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.