pub struct Text {
pub pieces: Vec<TextPiece>,
}
Expand description
Some text, either a line or an argument to an expression.
Fields§
§pieces: Vec<TextPiece>
The pieces of the text.
Implementations§
Source§impl Text
impl Text
Sourcepub fn extend_with_formatted_text(
&mut self,
text_formatting: TextFormatting,
text: &str,
)
pub fn extend_with_formatted_text( &mut self, text_formatting: TextFormatting, text: &str, )
Extend the current last text piece with the given string,
or append a new text piece created from the given string if there is no text piece
or the last text piece is not of variant Text
or has different formatting.
Sourcepub fn trim_self_start(&mut self)
pub fn trim_self_start(&mut self)
Trim whitespace from the beginning of the text.
Sourcepub fn trim_self_end(&mut self)
pub fn trim_self_end(&mut self)
Trim whitespace from the end of the text.
Trait Implementations§
impl Eq for Text
impl StructuralPartialEq for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin 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