[−][src]Struct tui::widgets::Block
Base widget to be used with all upper level ones. It may be used to display a box border around the widget and/or add a title.
Examples
Block::default() .title("Block") .title_style(Style::default().fg(Color::Red)) .borders(Borders::LEFT | Borders::RIGHT) .border_style(Style::default().fg(Color::White)) .style(Style::default().bg(Color::Black));
Methods
impl<'a> Block<'a>
[src]
pub fn title(self, title: &'a str) -> Block<'a>
[src]
pub fn title_style(self, style: Style) -> Block<'a>
[src]
pub fn border_style(self, style: Style) -> Block<'a>
[src]
pub fn style(self, style: Style) -> Block<'a>
[src]
pub fn borders(self, flag: Borders) -> Block<'a>
[src]
pub fn inner(&self, area: Rect) -> Rect
[src]
Compute the inner area of a block based on its border visibility rules.
Trait Implementations
impl<'a> Widget for Block<'a>
[src]
fn draw(&mut self, area: Rect, buf: &mut Buffer)
[src]
fn background(&self, area: Rect, buf: &mut Buffer, color: Color)
[src]
Helper method to quickly set the background of all cells inside the specified area.
fn render<B>(&mut self, f: &mut Frame<B>, area: Rect) where
Self: Sized,
B: Backend,
[src]
Self: Sized,
B: Backend,
Helper method that can be chained with a widget's builder methods to render it.
impl<'a> Copy for Block<'a>
[src]
impl<'a> Clone for Block<'a>
[src]
fn clone(&self) -> Block<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Default for Block<'a>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,