[−][src]Struct tui::widgets::Paragraph
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]
T: Iterator<Item = &'t Text<'t>>,
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]
T: Iterator<Item = &'t Text<'t>>,
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.
Auto Trait Implementations
impl<'a, 't, T> Send for Paragraph<'a, 't, T> where
T: Send,
T: Send,
impl<'a, 't, T> Sync for Paragraph<'a, 't, T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,