pub struct Block<'a> { /* private fields */ }Expand description
A widget that draws a block with optional borders, title, and padding.
Implementations§
Source§impl<'a> Block<'a>
impl<'a> Block<'a>
Sourcepub fn border_style(self, style: Style) -> Self
pub fn border_style(self, style: Style) -> Self
Set the style applied to border characters.
Sourcepub fn border_type(self, border_type: BorderType) -> Self
pub fn border_type(self, border_type: BorderType) -> Self
Set the border character set (e.g. square, rounded, double).
Sourcepub fn title_alignment(self, alignment: Alignment) -> Self
pub fn title_alignment(self, alignment: Alignment) -> Self
Set the horizontal alignment of the title.
Sourcepub fn inner(&self, area: Rect) -> Rect
pub fn inner(&self, area: Rect) -> Rect
Compute the inner area inside the block’s borders and padding.
Sourcepub fn chrome_size(&self) -> (u16, u16)
pub fn chrome_size(&self) -> (u16, u16)
Calculate the chrome (border + padding) size consumed by this block.
Returns (horizontal_chrome, vertical_chrome) representing the
total width and height consumed by borders and padding.
Trait Implementations§
Source§impl MeasurableWidget for Block<'_>
impl MeasurableWidget for Block<'_>
impl<'a> Eq for Block<'a>
impl<'a> StructuralPartialEq for Block<'a>
Auto Trait Implementations§
impl<'a> Freeze for Block<'a>
impl<'a> RefUnwindSafe for Block<'a>
impl<'a> Send for Block<'a>
impl<'a> Sync for Block<'a>
impl<'a> Unpin for Block<'a>
impl<'a> UnsafeUnpin for Block<'a>
impl<'a> UnwindSafe for Block<'a>
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.