[][src]Enum async_graphql_parser::Error

#[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,
}

Parser error.

Variants (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.
Syntax

A syntax error occurred.

Fields of Syntax

message: String

The message of the error, nicely formatted with newlines.

start: Pos

The start position of the error.

end: Option<Pos>

The end position of the error, if present.

MultipleRoots

The schema contained multiple query, mutation or subscription roots.

Fields of MultipleRoots

root: OperationType

The type of root that was duplicated.

schema: Pos

The position of the schema.

pos: Pos

The position of the second root.

MissingQueryRoot

The schema contained no query root.

Fields of MissingQueryRoot

pos: Pos

The position of the schema.

MultipleOperations

Multiple operations were found in a document with an anonymous one.

Fields of MultipleOperations

anonymous: Pos

The position of the anonymous operation.

operation: Pos

The position of the other operation.

OperationDuplicated

An operation is defined multiple times in a document.

Fields of OperationDuplicated

operation: Name

The name of the operation.

first: Pos

The position of the first definition.

second: Pos

The position of the second definition.

FragmentDuplicated

A fragment is defined multiple times in a document.

Fields of FragmentDuplicated

fragment: Name

The name of the fragment.

first: Pos

The position of the first definition.

second: Pos

The position of the second definition.

MissingOperation

The document does not contain any operation.

Implementations

impl Error[src]

#[must_use]pub fn positions(&self) -> ErrorPositions

Notable traits for ErrorPositions

impl Iterator for ErrorPositions type Item = Pos;
[src]

Get an iterator over the positions of the error.

The iterator is ordered from most important to least important position.

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Eq for Error[src]

impl Error for Error[src]

impl<R: RuleType> From<Error<R>> for Error[src]

impl PartialEq<Error> for Error[src]

impl StructuralEq for Error[src]

impl StructuralPartialEq for Error[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.