pub struct RenderedText { /* private fields */ }Expand description
A snapshot of the text a TextViewState renders,
as of one parse of its content.
Offsets into it are UTF-8 byte offsets. It is the string plain copy
produces: hello **world** renders as hello world, escapes are
resolved, and heading markers and list markers are left out. Blocks end
with a newline and table cells are joined with a space; those separators
belong to no block, so no highlight paints them.
Two snapshots are equal when they come from the same view and the same
parse. Comparing the current rendered_text with the one last searched
tells an observer of the view whether its content changed, so setting
highlights, which notifies the view too, does not start another search.
The text itself is only built when it is first read, from the parsed
document the snapshot holds on to, so drop a snapshot that is no longer
needed rather than keeping it past many changes.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RenderedText
impl !UnwindSafe for RenderedText
impl Freeze for RenderedText
impl Send for RenderedText
impl Sync for RenderedText
impl Unpin for RenderedText
impl UnsafeUnpin for RenderedText
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more