pub enum QueryParseErr {
BadCharacter(usize),
MissingField,
MissingNumber(usize),
BadArray(usize),
BadField(usize),
UnexpectedEOF(char),
Unexpected(usize, char),
BadIndex(usize, String),
}
Expand description
An enum representing errors possible while parsing a query.
All usize
fields in these errors represent the character index where the parser detected the failure.
Variants§
BadCharacter(usize)
Each parsable element must start with ‘.’ or ‘[’
MissingField
Need a field name; encountered a “..” in the query.
MissingNumber(usize)
Need a number; encountered a “[]” in the query.
BadArray(usize)
Got some kind of non-decimal digit inside the brackets “[]”.
BadField(usize)
Got some kind of bad character (or whitespace) inside a ‘.’
UnexpectedEOF(char)
Reached the end of the string while looking for a specific character (probably ‘]’)
Unexpected(usize, char)
Found a strange character at the given position.
BadIndex(usize, String)
Could not parse the number in your brackets to a usize. String is the IntError in question.
Trait Implementations§
Source§impl Clone for QueryParseErr
impl Clone for QueryParseErr
Source§fn clone(&self) -> QueryParseErr
fn clone(&self) -> QueryParseErr
Returns a copy of the value. Read more
1.0.0 · 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 QueryParseErr
impl Debug for QueryParseErr
Source§impl Display for QueryParseErr
impl Display for QueryParseErr
Source§impl Error for QueryParseErr
impl Error for QueryParseErr
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 QueryParseErr
impl PartialEq for QueryParseErr
Source§impl Serialize for QueryParseErr
impl Serialize for QueryParseErr
impl Eq for QueryParseErr
impl StructuralPartialEq for QueryParseErr
Auto Trait Implementations§
impl Freeze for QueryParseErr
impl RefUnwindSafe for QueryParseErr
impl Send for QueryParseErr
impl Sync for QueryParseErr
impl Unpin for QueryParseErr
impl UnwindSafe for QueryParseErr
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