Struct ratatui_block::block_border::BlockBorder
source · pub struct BlockBorder { /* private fields */ }Expand description
Border for a Block.
Borders are rendered as four lines along the sides. Be aware that the corners are thrown in with the top/bottom lines.

The BorderSymbolSet maps geometrical positions along the lines to the actual glyphs used.

Implementations§
source§impl BlockBorder
impl BlockBorder
sourcepub fn from_layout(
areas: &[Rect],
borders: &[BorderType],
select: usize,
) -> Self
pub fn from_layout( areas: &[Rect], borders: &[BorderType], select: usize, ) -> Self
New block border for a Block that is part of some bigger layout.
Given all the areas of the layout and each border type, this creates a border that is connected at the edges.
The resulting border can only be rendered for an area of the same size.
sourcepub fn border_style(self, style: Style) -> Self
pub fn border_style(self, style: Style) -> Self
Border style for the border.
sourcepub fn border_type(self, border: BorderType) -> Self
pub fn border_type(self, border: BorderType) -> Self
Sets the border type used.
sourcepub fn border_set(self, border_set: Box<dyn BorderSymbolSet>) -> Self
pub fn border_set(self, border_set: Box<dyn BorderSymbolSet>) -> Self
Use a BorderSymbolSet.
sourcepub fn get_symbol(&self, area: Rect, position: Position) -> BorderSymbol
pub fn get_symbol(&self, area: Rect, position: Position) -> BorderSymbol
Return the symbol at the given position along the border.
When using the returned BorderSymbol you must be aware, that the corners are rendered with the top and bottom lines.
x
Panic
Panics if the dimensions of the area don’t match a prefabricated border. Panics if the given position doesn’t lie on the border.
Trait Implementations§
source§impl Clone for BlockBorder
impl Clone for BlockBorder
source§impl Debug for BlockBorder
impl Debug for BlockBorder
source§impl Default for BlockBorder
impl Default for BlockBorder
source§impl Widget for &BlockBorder
impl Widget for &BlockBorder
Auto Trait Implementations§
impl Freeze for BlockBorder
impl !RefUnwindSafe for BlockBorder
impl !Send for BlockBorder
impl !Sync for BlockBorder
impl Unpin for BlockBorder
impl !UnwindSafe for BlockBorder
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more