pub struct StyledText {
pub text: String,
pub spans: Vec<Span>,
pub links: Vec<Rc<str>>,
pub char_count: u32,
pub has_links: bool,
pub is_ascii: bool,
}Expand description
Styled text: a string with inline formatting spans.
Fields§
§text: String§spans: Vec<Span>§links: Vec<Rc<str>>Deduplicated link URLs referenced by SpanStyle::link_idx.
char_count: u32Cached character count (avoids repeated O(n) UTF-8 scans for non-ASCII text).
has_links: boolWhether any span has a link (avoids linear scan in render path).
is_ascii: boolWhether the accumulated text is entirely ASCII.
Implementations§
Trait Implementations§
Source§impl Clone for StyledText
impl Clone for StyledText
Source§fn clone(&self) -> StyledText
fn clone(&self) -> StyledText
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StyledText
impl Debug for StyledText
Auto Trait Implementations§
impl Freeze for StyledText
impl RefUnwindSafe for StyledText
impl !Send for StyledText
impl !Sync for StyledText
impl Unpin for StyledText
impl UnsafeUnpin for StyledText
impl UnwindSafe for StyledText
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