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 scroll_mode(self, scroll_mode: ScrollMode) -> Paragraph<'a, 't, T>
pub fn scroll_overflow_char( self, scroll_overflow_char: Option<char>, ) -> Paragraph<'a, 't, T>
pub fn alignment(self, alignment: Alignment) -> Paragraph<'a, 't, T>
pub fn did_overflow(self, over: Rc<Cell<bool>>) -> Paragraph<'a, 't, T>
pub fn at_top(self, top: Rc<Cell<bool>>) -> Paragraph<'a, 't, T>
Trait Implementations§
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>
impl<'a, 't, T> !Send for Paragraph<'a, 't, T>
impl<'a, 't, T> !Sync for Paragraph<'a, 't, T>
impl<'a, 't, T> Unpin for Paragraph<'a, 't, T>where
T: Unpin,
impl<'a, 't, T> UnsafeUnpin for Paragraph<'a, 't, T>where
T: UnsafeUnpin,
impl<'a, 't, T> !UnwindSafe for Paragraph<'a, 't, T>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more