pub enum QueryError {
InvalidLanguage(LanguageError),
InvalidInput,
ExpectedMapping(String),
ExpectedList(usize),
ExhaustedMapping(String),
ExhaustedList(usize, usize),
UnexpectedNode(String),
MissingChild(String, String),
MissingChildField(String, &'static str),
Other(String),
}Expand description
Possible errors when performing YAML path queries.
Variants§
InvalidLanguage(LanguageError)
The tree-sitter backend couldn’t accept the YAML grammar.
InvalidInput
The user’s input YAML is malformed.
ExpectedMapping(String)
The query expects a key at a given point, but the input isn’t a mapping.
ExpectedList(usize)
The query expects a list index at a given point, but the input isn’t a list.
ExhaustedMapping(String)
The query expects the given key in a mapping, but the mapping doesn’t have that key.
ExhaustedList(usize, usize)
The query expects the given list index, but the list isn’t the right size.
UnexpectedNode(String)
The YAML syntax tree wasn’t structured the way we expect.
MissingChild(String, String)
The YAML syntax tree is missing an expected named child node.
MissingChildField(String, &'static str)
The YAML syntax tree is missing an expected named child node with the given field name.
Other(String)
Any other query error that doesn’t fit cleanly above.
Trait Implementations§
Source§impl Debug for QueryError
impl Debug for QueryError
Source§impl Display for QueryError
impl Display for QueryError
Source§impl Error for QueryError
impl Error for QueryError
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 From<LanguageError> for QueryError
impl From<LanguageError> for QueryError
Source§fn from(source: LanguageError) -> Self
fn from(source: LanguageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for QueryError
impl RefUnwindSafe for QueryError
impl Send for QueryError
impl Sync for QueryError
impl Unpin for QueryError
impl UnwindSafe for QueryError
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