pub struct LineTokens<'text, 'spans> {
pub line_index: usize,
pub byte_range: Range<usize>,
pub text: &'text str,
pub scopes: &'spans [ScopeSpan],
}Expand description
Borrowed tokenization result for a line visited by a range highlighter.
This is the zero-copy callback view used when callers need grammar scopes but not themed styles. 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.
Trait Implementations§
Auto Trait Implementations§
impl<'text, 'spans> Freeze for LineTokens<'text, 'spans>
impl<'text, 'spans> RefUnwindSafe for LineTokens<'text, 'spans>
impl<'text, 'spans> Send for LineTokens<'text, 'spans>
impl<'text, 'spans> Sync for LineTokens<'text, 'spans>
impl<'text, 'spans> Unpin for LineTokens<'text, 'spans>
impl<'text, 'spans> UnsafeUnpin for LineTokens<'text, 'spans>
impl<'text, 'spans> UnwindSafe for LineTokens<'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