pub struct Text { /* private fields */ }Expand description
A line of text.
The text, ellipsis and max_lines change the layout. Color and font
come from the nearest widget whose Style sets them, starting with the
text’s own.
Implementations§
Source§impl Text
impl Text
Sourcepub fn new(text: impl IntoProp<String>) -> Text
pub fn new(text: impl IntoProp<String>) -> Text
Text showing text: a string, or a closure that returns a String.
Sourcepub fn ellipsis(self, ellipsis: impl IntoProp<bool>) -> Text
pub fn ellipsis(self, ellipsis: impl IntoProp<bool>) -> Text
When on, text that doesn’t fit ends in “…” instead of being cut off. Off by default.
Trait Implementations§
Source§impl Widget for Text
impl Widget for Text
Source§fn into_element(self: Box<Self>) -> Element
fn into_element(self: Box<Self>) -> Element
Turns the description, and everything inside it, into the element
the window builds nodes from. It runs when the window is created or a
list item first appears, before the window’s tree is touched and
without recording what it reads, so it only describes.
Auto Trait Implementations§
impl !RefUnwindSafe for Text
impl !Send for Text
impl !Sync for Text
impl !UnwindSafe for Text
impl Forget for Text
impl Freeze for Text
impl Move for Text
impl Unpin for Text
impl UnsafeUnpin 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