[][src]Struct tui::widgets::Paragraph

pub struct Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
{ /* fields omitted */ }

A widget to display some text.

Examples

let text = [
    Text::raw("First line\n"),
    Text::styled("Second line\n", Style::default().fg(Color::Red))
];
Paragraph::new(text.iter())
    .block(Block::default().title("Paragraph").borders(Borders::ALL))
    .style(Style::default().fg(Color::White).bg(Color::Black))
    .alignment(Alignment::Center)
    .wrap(true);

Methods

impl<'a, 't, T> Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
[src]

pub fn new(text: T) -> Paragraph<'a, 't, T>[src]

pub fn block(self, block: Block<'a>) -> Paragraph<'a, 't, T>[src]

pub fn style(self, style: Style) -> Paragraph<'a, 't, T>[src]

pub fn wrap(self, flag: bool) -> Paragraph<'a, 't, T>[src]

pub fn raw(self, flag: bool) -> Paragraph<'a, 't, T>[src]

pub fn scroll(self, offset: u16) -> Paragraph<'a, 't, T>[src]

pub fn alignment(self, alignment: Alignment) -> Paragraph<'a, 't, T>[src]

Trait Implementations

impl<'a, 't, 'b, T> Widget for Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
[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]

Helper method that can be chained with a widget's builder methods to render it.

Auto Trait Implementations

impl<'a, 't, T> Send for Paragraph<'a, 't, T> where
    T: Send

impl<'a, 't, T> Sync for Paragraph<'a, 't, T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]