#[non_exhaustive]pub enum HighlightError {
GrammarLoad {
language: Language,
message: String,
},
Query {
language: Language,
row: usize,
column: usize,
offset: usize,
kind: HighlightQueryErrorKind,
message: String,
},
Parse {
language: Language,
},
InvalidEdit {
start_byte: usize,
old_end_byte: usize,
new_end_byte: usize,
old_len: usize,
new_len: usize,
},
}Expand description
A typed error produced while preparing runtime syntax highlighting.
These errors are recoverable for renderers: callers can surface the error and render the original source as plaintext.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
GrammarLoad
The tree-sitter parser rejected the selected grammar.
Fields
Query
The tree-sitter highlights query failed to compile.
Fields
§
kind: HighlightQueryErrorKindThe query error kind.
Parse
Tree-sitter failed to parse the source.
InvalidEdit
Buffer::edit received offsets that are out of bounds or not on
UTF-8 character boundaries.
The buffer’s state is unchanged when this error is returned.
Fields
Trait Implementations§
Source§impl Clone for HighlightError
impl Clone for HighlightError
Source§fn clone(&self) -> HighlightError
fn clone(&self) -> HighlightError
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 moreSource§impl Debug for HighlightError
impl Debug for HighlightError
Source§impl Display for HighlightError
impl Display for HighlightError
Source§impl Error for HighlightError
impl Error for HighlightError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for HighlightError
impl PartialEq for HighlightError
Source§fn eq(&self, other: &HighlightError) -> bool
fn eq(&self, other: &HighlightError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for HighlightError
impl StructuralPartialEq for HighlightError
Auto Trait Implementations§
impl Freeze for HighlightError
impl RefUnwindSafe for HighlightError
impl Send for HighlightError
impl Sync for HighlightError
impl Unpin for HighlightError
impl UnsafeUnpin for HighlightError
impl UnwindSafe for HighlightError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.