pub struct RenderString { /* private fields */ }Expand description
What rendering reads from an AnnotatedString: content, styles, and
link identity — never the link handlers, which live UI-side only.
Unlike AnnotatedString this is plain owned data (Send + Sync), so a
lowered scene that carries it can cross threads. An AnnotatedString
keeps its content in one of these, which the renderer shares.
Built once and never changed, it hashes itself when built: renderers key
caches by RenderString::render_hash every frame.
Implementations§
Source§impl RenderString
impl RenderString
Sourcepub fn span_styles(&self) -> &[RangeStyle<SpanStyle>]
pub fn span_styles(&self) -> &[RangeStyle<SpanStyle>]
Character styles with the byte ranges they cover.
Sourcepub fn paragraph_styles(&self) -> &[RangeStyle<ParagraphStyle>]
pub fn paragraph_styles(&self) -> &[RangeStyle<ParagraphStyle>]
Paragraph styles with the byte ranges they cover.
Sourcepub fn string_annotations(&self) -> &[RangeStyle<StringAnnotation>]
pub fn string_annotations(&self) -> &[RangeStyle<StringAnnotation>]
Tag and value annotations with the byte ranges they cover.
Sourcepub fn links(&self) -> &[RangeStyle<LinkKey>]
pub fn links(&self) -> &[RangeStyle<LinkKey>]
Link ranges by identity (tag/url): enough to hash and to key caches, never enough to invoke a link.
Sourcepub fn span_boundaries(&self) -> SpanBoundaries
pub fn span_boundaries(&self) -> SpanBoundaries
Returns a sorted list of unique byte indices where styles change.
Sourcepub fn render_hash(&self) -> u64
pub fn render_hash(&self) -> u64
Hash of the text and of the span and paragraph styles, as renderers use it to key caches.
Sourcepub fn subsequence(&self, range: Range<usize>) -> Self
pub fn subsequence(&self, range: Range<usize>) -> Self
Returns a new RenderString containing a substring of the original
text and any styles that overlap with the new range, with indices
adjusted.