pub struct DisplayChunk<'a> {
pub text: &'a str,
pub buffer_bytes: Range<u32>,
pub cells: u32,
pub is_tab: bool,
}Expand description
One render run of a display row, split at every tab boundary so the renderer can draw tab invisibles and overlay highlight spans onto each run.
Fields§
§text: &'a strThe run’s source text. For is_tab this is the literal "\t"; the
caller draws cells blanks (plus an optional invisible glyph) and never
paints these bytes.
buffer_bytes: Range<u32>Byte range within the buffer line — so a per-line HighlightSpan
(also byte-within-line) overlays this run with no coordinate hop.
cells: u32Width in cells (a tab: tab_width at the run’s start cell).
is_tab: boolWhether this run is a single tab (the renderer draws it as blanks).
Trait Implementations§
Source§impl<'a> Clone for DisplayChunk<'a>
impl<'a> Clone for DisplayChunk<'a>
Source§fn clone(&self) -> DisplayChunk<'a>
fn clone(&self) -> DisplayChunk<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for DisplayChunk<'a>
impl<'a> RefUnwindSafe for DisplayChunk<'a>
impl<'a> Send for DisplayChunk<'a>
impl<'a> Sync for DisplayChunk<'a>
impl<'a> Unpin for DisplayChunk<'a>
impl<'a> UnsafeUnpin for DisplayChunk<'a>
impl<'a> UnwindSafe for DisplayChunk<'a>
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