Enum async_graphql_parser::Error
source · [−]#[non_exhaustive]
pub enum Error {
Syntax {
message: String,
start: Pos,
end: Option<Pos>,
},
MultipleRoots {
root: OperationType,
schema: Pos,
pos: Pos,
},
MissingQueryRoot {
pos: Pos,
},
MultipleOperations {
anonymous: Pos,
operation: Pos,
},
OperationDuplicated {
operation: Name,
first: Pos,
second: Pos,
},
FragmentDuplicated {
fragment: Name,
first: Pos,
second: Pos,
},
MissingOperation,
}Expand description
Parser error.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Syntax
Fields
message: StringThe message of the error, nicely formatted with newlines.
start: PosThe start position of the error.
A syntax error occurred.
MultipleRoots
Fields
root: OperationTypeThe type of root that was duplicated.
schema: PosThe position of the schema.
pos: PosThe position of the second root.
The schema contained multiple query, mutation or subscription roots.
MissingQueryRoot
Fields
pos: PosThe position of the schema.
The schema contained no query root.
MultipleOperations
Fields
anonymous: PosThe position of the anonymous operation.
operation: PosThe position of the other operation.
Multiple operations were found in a document with an anonymous one.
OperationDuplicated
Fields
operation: NameThe name of the operation.
first: PosThe position of the first definition.
second: PosThe position of the second definition.
An operation is defined multiple times in a document.
FragmentDuplicated
Fields
fragment: NameThe name of the fragment.
first: PosThe position of the first definition.
second: PosThe position of the second definition.
A fragment is defined multiple times in a document.
MissingOperation
The document does not contain any operation.
Implementations
sourceimpl Error
impl Error
sourcepub fn positions(&self) -> ErrorPositionsⓘNotable traits for ErrorPositionsimpl Iterator for ErrorPositions type Item = Pos;
pub fn positions(&self) -> ErrorPositionsⓘNotable traits for ErrorPositionsimpl Iterator for ErrorPositions type Item = Pos;
Get an iterator over the positions of the error.
The iterator is ordered from most important to least important position.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more