Enum async_graphql_parser::Error[][src]

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

Get an iterator over the positions of the error.

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.