pub struct HighlightResult {
pub lines: Vec<OwnedLine>,
}Expand description
An owned highlighting snapshot that remains valid after its document changes.
Fields§
§lines: Vec<OwnedLine>Lines in source order, including a final empty line after a trailing newline.
Implementations§
Source§impl HighlightResult
impl HighlightResult
Sourcepub fn as_highlighted(&self) -> Highlighted<'_>
pub fn as_highlighted(&self) -> Highlighted<'_>
Create a borrowed view of this snapshot without parsing or running queries.
The view borrows token strings and allocates new line and token vectors. The view cannot outlive this snapshot.
Sourcepub fn with_highlighted_lines(&self, lines: &[usize]) -> Highlighted<'_>
pub fn with_highlighted_lines(&self, lines: &[usize]) -> Highlighted<'_>
Create a borrowed view with different line emphasis, without re-highlighting.
Trait Implementations§
Source§impl Clone for HighlightResult
impl Clone for HighlightResult
Source§impl Debug for HighlightResult
impl Debug for HighlightResult
impl Eq for HighlightResult
Source§impl PartialEq for HighlightResult
impl PartialEq for HighlightResult
impl StructuralPartialEq for HighlightResult
Auto Trait Implementations§
impl Forget for HighlightResult
impl Freeze for HighlightResult
impl Move for HighlightResult
impl RefUnwindSafe for HighlightResult
impl Send for HighlightResult
impl Sync for HighlightResult
impl Unpin for HighlightResult
impl UnsafeUnpin for HighlightResult
impl UnwindSafe for HighlightResult
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