pub enum TextSpan {
Plain(String),
Bold(Vec<TextSpan>),
Italic(Vec<TextSpan>),
Highlight(Vec<TextSpan>),
Comment(Vec<TextSpan>),
Span(SpanAttributes, Vec<TextSpan>),
}Expand description
A segment of text that may contain inline markup formatting.
TextSpan represents a tree structure where each node is either plain text
or a formatting tag wrapping child spans. This allows arbitrary nesting of
inline markup.
Variants§
Plain(String)
Plain text with no formatting.
Bold(Vec<TextSpan>)
Bold text (<bold> / <b>).
Italic(Vec<TextSpan>)
Italic text (<italic> / <i>).
Highlight(Vec<TextSpan>)
Highlighted text (<highlight>).
Comment(Vec<TextSpan>)
Comment-styled text (<comment>).
Span(SpanAttributes, Vec<TextSpan>)
Styled text with attributes (<span ...>).
Implementations§
Trait Implementations§
impl StructuralPartialEq for TextSpan
Auto Trait Implementations§
impl Freeze for TextSpan
impl RefUnwindSafe for TextSpan
impl Send for TextSpan
impl Sync for TextSpan
impl Unpin for TextSpan
impl UnsafeUnpin for TextSpan
impl UnwindSafe for TextSpan
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