pub struct StyledLine<'text, 'spans> {
pub line_index: usize,
pub byte_range: Range<usize>,
pub text: &'text str,
pub scopes: &'spans [ScopeSpan],
pub styles: &'spans [StyleSpan],
}Expand description
Borrowed tokenization and styling result for a line visited by a range highlighter.
This is the zero-copy callback view used when callers need both grammar scopes and theme-resolved style spans. The borrowed text and spans remain valid only for the duration of the callback.
Fields§
§line_index: usizeZero-based line index in the blob.
byte_range: Range<usize>Byte range of this line in the blob, excluding line terminators.
text: &'text strLine text, excluding line terminators.
scopes: &'spans [ScopeSpan]Scope spans for this line.
styles: &'spans [StyleSpan]Styled spans for this line.
Trait Implementations§
Auto Trait Implementations§
impl<'text, 'spans> Freeze for StyledLine<'text, 'spans>
impl<'text, 'spans> RefUnwindSafe for StyledLine<'text, 'spans>
impl<'text, 'spans> Send for StyledLine<'text, 'spans>
impl<'text, 'spans> Sync for StyledLine<'text, 'spans>
impl<'text, 'spans> Unpin for StyledLine<'text, 'spans>
impl<'text, 'spans> UnsafeUnpin for StyledLine<'text, 'spans>
impl<'text, 'spans> UnwindSafe for StyledLine<'text, 'spans>
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