pub struct RenderString {
pub text: String,
pub span_styles: Vec<RangeStyle<SpanStyle>>,
pub paragraph_styles: Vec<RangeStyle<ParagraphStyle>>,
pub string_annotations: Vec<RangeStyle<StringAnnotation>>,
pub links: Vec<RangeStyle<LinkKey>>,
}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.
Fields§
§text: String§span_styles: Vec<RangeStyle<SpanStyle>>§paragraph_styles: Vec<RangeStyle<ParagraphStyle>>§string_annotations: Vec<RangeStyle<StringAnnotation>>§links: Vec<RangeStyle<LinkKey>>Link ranges by identity (tag/url) — enough to hash and to key caches, never enough to invoke a link.
Implementations§
Source§impl RenderString
impl RenderString
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn span_boundaries(&self) -> Vec<usize>
pub fn span_boundaries(&self) -> Vec<usize>
Returns a sorted list of unique byte indices where styles change.
Mirrors AnnotatedString::span_boundaries.
Sourcepub fn render_hash(&self) -> u64
pub fn render_hash(&self) -> u64
Mirrors AnnotatedString::render_hash: hashes the exact same fields
with the exact same formula, so a cache keyed by either stays keyed by
the same distinctions.
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. Mirrors AnnotatedString::subsequence.
Trait Implementations§
Source§impl Clone for RenderString
impl Clone for RenderString
Source§fn clone(&self) -> RenderString
fn clone(&self) -> RenderString
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more