pub struct Paragraph<'a, 't, T>{ /* private fields */ }Expand description
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);Implementations§
Source§impl<'a, 't, T> Paragraph<'a, 't, T>
impl<'a, 't, T> Paragraph<'a, 't, T>
pub fn new(text: T) -> Paragraph<'a, 't, T>
pub fn block(self, block: Block<'a>) -> Paragraph<'a, 't, T>
pub fn style(self, style: Style) -> Paragraph<'a, 't, T>
pub fn wrap(self, flag: bool) -> Paragraph<'a, 't, T>
pub fn raw(self, flag: bool) -> Paragraph<'a, 't, T>
pub fn scroll(self, offset: u16) -> Paragraph<'a, 't, T>
pub fn alignment(self, alignment: Alignment) -> Paragraph<'a, 't, T>
Trait Implementations§
Source§impl<'a, 't, 'b, T> Widget for Paragraph<'a, 't, T>
impl<'a, 't, 'b, T> Widget for Paragraph<'a, 't, T>
Source§fn draw(&mut self, area: Rect, buf: &mut Buffer)
fn draw(&mut self, area: Rect, buf: &mut Buffer)
Draws the current state of the widget in the given buffer. That the only method required to
implement a custom widget.
Auto Trait Implementations§
impl<'a, 't, T> Freeze for Paragraph<'a, 't, T>where
T: Freeze,
impl<'a, 't, T> RefUnwindSafe for Paragraph<'a, 't, T>where
T: RefUnwindSafe,
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,
impl<'a, 't, T> Unpin for Paragraph<'a, 't, T>where
T: Unpin,
impl<'a, 't, T> UnwindSafe for Paragraph<'a, 't, T>where
T: UnwindSafe,
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