#[non_exhaustive]
pub enum DiagnosticData {
Show 47 variants SyntaxError { message: String, }, LimitExceeded { message: String, }, MissingIdent, ExecutableDefinition { kind: &'static str, }, UniqueDefinition { ty: &'static str, name: String, original_definition: DiagnosticLocation, redefined_definition: DiagnosticLocation, }, UniqueArgument { name: String, original_definition: DiagnosticLocation, redefined_definition: DiagnosticLocation, }, UniqueInputValue { name: String, original_value: DiagnosticLocation, redefined_value: DiagnosticLocation, }, SingleRootField { fields: usize, subscription: DiagnosticLocation, }, UnsupportedOperation { ty: &'static str, }, UndefinedField { field: String, ty: String, }, UndefinedArgument { name: String, }, UndefinedDefinition { name: String, }, UndefinedDirective { name: String, }, UndefinedVariable { name: String, }, UndefinedFragment { name: String, }, UndefinedValue { value: String, definition: String, }, WrongTypeExtension { name: String, definition: DiagnosticLocation, extension: DiagnosticLocation, }, RecursiveDirectiveDefinition { name: String, }, RecursiveInterfaceDefinition { name: String, }, RecursiveInputObjectDefinition { name: String, }, RecursiveFragmentDefinition { name: String, }, CapitalizedValue { value: String, }, UniqueField { field: String, original_definition: DiagnosticLocation, redefined_definition: DiagnosticLocation, }, MissingField { field: String, }, RequiredArgument { name: String, }, DuplicateImplementsInterface { ty: String, interface: String, }, TransitiveImplementedInterfaces { missing_interface: String, }, OutputType { name: String, ty: &'static str, }, InputType { name: String, ty: &'static str, }, ScalarSpecificationURL, QueryRootOperationType, BuiltInScalarDefinition, UnusedVariable { name: String, }, ObjectType { name: String, ty: &'static str, }, UnsupportedLocation { name: String, dir_loc: DirectiveLocation, directive_def: DiagnosticLocation, }, UnsupportedValueType { value: String, ty: String, }, IntCoercionError { value: String, }, UniqueDirective { name: String, original_call: DiagnosticLocation, conflicting_call: DiagnosticLocation, }, IntrospectionField { field: String, }, DisallowedSubselection, MissingSubselection, ConflictingField { field: String, original_selection: DiagnosticLocation, redefined_selection: DiagnosticLocation, }, InvalidFragment { ty: Option<String>, }, InvalidFragmentTarget { ty: String, }, InvalidFragmentSpread { name: Option<String>, type_name: String, }, UnusedFragment { name: String, }, DisallowedVariableUsage { var_name: String, arg_name: String, },
}
Expand description

Structured data about a diagnostic.

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.
§

SyntaxError

Fields

§message: String
§

LimitExceeded

Fields

§message: String
§

MissingIdent

§

ExecutableDefinition

Fields

§kind: &'static str
§

UniqueDefinition

Fields

§ty: &'static str
§name: String
§original_definition: DiagnosticLocation
§redefined_definition: DiagnosticLocation
§

UniqueArgument

Fields

§name: String
§original_definition: DiagnosticLocation
§redefined_definition: DiagnosticLocation
§

UniqueInputValue

Fields

§name: String
§original_value: DiagnosticLocation
§redefined_value: DiagnosticLocation
§

SingleRootField

Fields

§fields: usize
§subscription: DiagnosticLocation
§

UnsupportedOperation

Fields

§ty: &'static str
§

UndefinedField

Fields

§field: String

Field name

§ty: String

Type name being queried

§

UndefinedArgument

Fields

§name: String
§

UndefinedDefinition

Fields

§name: String

Name of the type not in scope

§

UndefinedDirective

Fields

§name: String

Name of the missing directive

§

UndefinedVariable

Fields

§name: String

Name of the variable not in scope

§

UndefinedFragment

Fields

§name: String

Name of the fragment not in scope

§

UndefinedValue

Fields

§value: String

Value of the enum that doesn’t exist

§definition: String

type definition

§

WrongTypeExtension

Fields

§name: String

Name of the type being extended

§definition: DiagnosticLocation

Location of the original definition. This may be None when extending a builtin GraphQL type.

§extension: DiagnosticLocation

Location of the extension

§

RecursiveDirectiveDefinition

Fields

§name: String
§

RecursiveInterfaceDefinition

Fields

§name: String
§

RecursiveInputObjectDefinition

Fields

§name: String
§

RecursiveFragmentDefinition

Fields

§name: String
§

CapitalizedValue

Fields

§value: String
§

UniqueField

Fields

§field: String

Name of the non-unique field.

§original_definition: DiagnosticLocation
§redefined_definition: DiagnosticLocation
§

MissingField

Fields

§field: String
§

RequiredArgument

Fields

§name: String
§

DuplicateImplementsInterface

Fields

§interface: String
§

TransitiveImplementedInterfaces

Fields

§missing_interface: String
§

OutputType

Fields

§name: String
§ty: &'static str
§

InputType

Fields

§name: String
§ty: &'static str
§

ScalarSpecificationURL

§

QueryRootOperationType

§

BuiltInScalarDefinition

§

UnusedVariable

Fields

§name: String
§

ObjectType

Fields

§name: String
§ty: &'static str
§

UnsupportedLocation

Fields

§name: String

current directive definition

§dir_loc: DirectiveLocation

current location where the directive is used

§directive_def: DiagnosticLocation

The source location where the directive that’s being used was defined.

§

UnsupportedValueType

Fields

§value: String
§

IntCoercionError

Fields

§value: String

The int value that cannot be coerced

§

UniqueDirective

Fields

§name: String

Name of the non-unique directive.

§original_call: DiagnosticLocation
§conflicting_call: DiagnosticLocation
§

IntrospectionField

Fields

§field: String

Name of the field

§

DisallowedSubselection

§

MissingSubselection

§

ConflictingField

Fields

§field: String

Name of the non-unique field.

§original_selection: DiagnosticLocation
§redefined_selection: DiagnosticLocation
§

InvalidFragment

Fields

§ty: Option<String>

Name of the type on which the fragment is declared

§

InvalidFragmentTarget

Fields

§ty: String

Name of the type on which the fragment is declared

§

InvalidFragmentSpread

Fields

§name: Option<String>

Fragment name or None if it’s an inline fragment

§type_name: String

Type name the fragment is being applied to

§

UnusedFragment

Fields

§name: String

Name of the fragment

§

DisallowedVariableUsage

Fields

§var_name: String

Name of the variable being used in an argument

§arg_name: String

Name of the argument where variable is used

Implementations§

source§

impl DiagnosticData

source

pub fn is_error(&self) -> bool

source

pub fn is_warning(&self) -> bool

source

pub fn is_advice(&self) -> bool

Trait Implementations§

source§

impl Clone for DiagnosticData

source§

fn clone(&self) -> DiagnosticData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DiagnosticData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for DiagnosticData

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for DiagnosticData

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

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

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Hash for DiagnosticData

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<DiagnosticData> for DiagnosticData

source§

fn eq(&self, other: &DiagnosticData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for DiagnosticData

source§

impl StructuralEq for DiagnosticData

source§

impl StructuralPartialEq for DiagnosticData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> Fmt for Twhere T: Display,

source§

fn fg<C>(self, color: C) -> Foreground<Self>where C: Into<Option<Color>>, Self: Display,

Give this value the specified foreground colour.
source§

fn bg<C>(self, color: C) -> Background<Self>where C: Into<Option<Color>>, Self: Display,

Give this value the specified background colour.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.