pub struct Text { /* private fields */ }Expand description
A run of styled spans, word-wrapped at the render width. Newlines inside span content start new lines.
Implementations§
Trait Implementations§
Source§impl Element for Text
impl Element for Text
Source§fn height(&self, width: u16) -> u16
fn height(&self, width: u16) -> u16
Rows needed at the given width. Exact, cheap, no side effects.
Source§fn render(&self, area: Rect, buf: &mut Buffer)
fn render(&self, area: Rect, buf: &mut Buffer)
Draw into
area of buf. area is sized by the caller from
height (possibly clamped at the buffer edge).Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnsafeUnpin for Text
impl UnwindSafe for Text
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<E> ElementExt for Ewhere
E: Element,
impl<E> ElementExt for Ewhere
E: Element,
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