pub struct RichText {
pub runs: Vec<TextRun>,
}Expand description
Rich text content with multiple formatted runs
Rich text allows different parts of a cell’s text to have different formatting (bold, italic, colors, etc.). This is common in spreadsheets where users want to emphasize certain words within a cell.
Fields§
§runs: Vec<TextRun>The text runs in order
Implementations§
Source§impl RichText
impl RichText
Sourcepub fn push_formatted(&mut self, text: String, font: Font)
pub fn push_formatted(&mut self, text: String, font: Font)
Add a formatted text run
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Get the plain text content (all runs concatenated)
Sourcepub fn has_formatting(&self) -> bool
pub fn has_formatting(&self) -> bool
Check if any run has formatting
Trait Implementations§
impl StructuralPartialEq for RichText
Auto Trait Implementations§
impl Freeze for RichText
impl RefUnwindSafe for RichText
impl Send for RichText
impl Sync for RichText
impl Unpin for RichText
impl UnsafeUnpin for RichText
impl UnwindSafe for RichText
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