#[non_exhaustive]pub struct StyledRun { /* private fields */ }Expand description
Text + style emitted by the layout engine. The flat run sequence is
what crate::layout::render_to_runs returns: one run per segment
plus one run per non-empty inter-segment separator. Consumers map
runs to their target surface — ANSI SGR for terminal stdout,
ratatui Span for the TUI preview pane — without re-parsing
escape sequences.
Fields are pub(crate) so external callers go through
StyledRun::new and the accessors; this mirrors
crate::segments::RenderedSegment and keeps room to enforce
text-content invariants later without a SemVer break.
Implementations§
Source§impl StyledRun
impl StyledRun
Sourcepub fn new(text: impl Into<String>, style: Style) -> Self
pub fn new(text: impl Into<String>, style: Style) -> Self
Build a run from text and style. Out-of-tree consumers of
crate::layout::runs_to_ansi go through this so future
invariants (escape-sequence rejection, width caching) can
land without breaking them.
Today the constructor performs no validation; sanitizing
untrusted text is the segment’s responsibility (see
crate::segments::RenderedSegment::new).
Trait Implementations§
impl Eq for StyledRun
impl StructuralPartialEq for StyledRun
Auto Trait Implementations§
impl Freeze for StyledRun
impl RefUnwindSafe for StyledRun
impl Send for StyledRun
impl Sync for StyledRun
impl Unpin for StyledRun
impl UnsafeUnpin for StyledRun
impl UnwindSafe for StyledRun
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
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.