Skip to main content

AnalysisError

Enum AnalysisError 

Source
#[non_exhaustive]
pub enum AnalysisError {
Show 29 variants UndefinedReference { name: DbString, span: SourceSpan, hint: Option<String>, }, Shadow { name: DbString, span: SourceSpan, prior_span: SourceSpan, }, PatternKindMismatch { name: DbString, prior: PatternElementKind, current: PatternElementKind, span: SourceSpan, prior_span: SourceSpan, }, AliasReusedAsPatternBinding { name: DbString, prior_kind: BindingDeclKind, new_kind: PatternElementKind, span: SourceSpan, }, NotImplemented { message: String, span: SourceSpan, hint: Option<String>, }, UnboundedRequiresGate { mode: PathMode, selector: Option<PathSelector>, span: SourceSpan, }, ValueSubqueryShapeViolation { message: String, span: SourceSpan, }, AggregateNestingViolation { message: String, span: SourceSpan, }, GroupedProjectionItemNotGrouped { span: SourceSpan, }, ReturnStarRequiresInput { span: SourceSpan, }, SortKeyContainsNestedQuery { span: SourceSpan, }, SortKeyContainsAggregate { span: SourceSpan, }, InvalidReference { message: String, span: SourceSpan, }, RecursionLimitExceeded { depth: u32, }, TypeMismatch { context: TypeMismatchContext, expected: ExpectedType, found: GqlType, span: SourceSpan, }, ConflictingParameterTypes { name: DbString, declarations: Vec<(GqlType, SourceSpan)>, }, UnknownProcedure { name: Box<[DbString]>, span: SourceSpan, }, WrongArgumentCount { procedure: Box<[DbString]>, expected: usize, minimum: usize, actual: usize, span: SourceSpan, }, UnknownYieldColumn { procedure: Box<[DbString]>, column: DbString, span: SourceSpan, }, MutatingProcedureInReadPipeline { procedure: Box<[DbString]>, mutability: ProcedureMutability, span: SourceSpan, }, SchemaUnknownNodeType { labels: LabelSet, graph_type: DbString, span: SourceSpan, }, SchemaUnknownEdgeType { label: DbString, graph_type: DbString, span: SourceSpan, }, SchemaEdgeEndpointMismatch { label: DbString, expected_source: String, expected_target: String, observed_source: Box<LabelSet>, observed_target: Box<LabelSet>, span: SourceSpan, }, SchemaUndeclaredProperty { property: DbString, declared_in: DbString, graph_type: DbString, span: SourceSpan, }, SchemaPropertyTypeMismatch { property: DbString, declared_in: DbString, expected: PropertyValueType, found: GqlType, span: SourceSpan, }, SchemaRequiredPropertyMissing { property: DbString, declared_in: DbString, span: SourceSpan, }, SchemaRequiredPropertyRemoved { property: DbString, declared_in: DbString, span: SourceSpan, }, SchemaInvalidInsertLabelExpr { form: InvalidLabelForm, span: SourceSpan, }, SchemaRequiredEdgeLabelRemoved { label: DbString, declared_in: DbString, span: SourceSpan, },
}
Expand description

Semantic-analysis failure.

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

UndefinedReference

A reference does not resolve to any binding in the enclosing scopes.

Fields

§name: DbString

Unresolved binding name.

§span: SourceSpan

Source span of the unresolved reference.

§hint: Option<String>

Optional repair hint.

§

Shadow

A strict declaration site redeclared a binding already present in its scope.

Fields

§name: DbString

Redeclared binding name.

§span: SourceSpan

Source span of the redeclaration.

§prior_span: SourceSpan

Source span of the prior declaration.

§

PatternKindMismatch

A pattern variable is reused with an element kind incompatible with its prior declaration (e.g. a node variable later used as an edge, or a path binding aliased over an existing node variable).

Fields

§name: DbString

Reused binding name.

§prior: PatternElementKind

Element kind of the prior declaration.

§current: PatternElementKind

Element kind of the new occurrence.

§span: SourceSpan

Source span of the new occurrence.

§prior_span: SourceSpan

Source span of the prior declaration.

§

AliasReusedAsPatternBinding

A value alias was reused where GQL requires a graph pattern binding.

Fields

§name: DbString

Reused binding name.

§prior_kind: BindingDeclKind

Prior non-pattern declaration kind.

§new_kind: PatternElementKind

New graph-pattern occurrence kind.

§span: SourceSpan

Source span of the new occurrence.

§

NotImplemented

The analyzer encountered an AST surface it does not route yet.

Fields

§message: String

Human-readable missing capability.

§span: SourceSpan

Source span requiring the missing analyzer capability.

§hint: Option<String>

Optional implementation hint.

§

UnboundedRequiresGate

ISO 16.4 forbids unbounded quantifiers without a restrictive or selective gate.

Fields

§mode: PathMode

Path mode in scope for the offending pattern.

§selector: Option<PathSelector>

Path selector in scope for the offending pattern.

§span: SourceSpan

Source span of the unbounded quantifier.

§

ValueSubqueryShapeViolation

ISO 20.6 scalar value query expression shape violation.

Fields

§message: String

Human-readable ISO 20.6 rule failure.

§span: SourceSpan

Source span of the invalid VALUE subquery shape.

§

AggregateNestingViolation

ISO 20.9 forbids aggregate functions directly containing aggregate functions.

Fields

§message: String

Human-readable ISO 20.9 rule failure.

§span: SourceSpan

Source span of the nested aggregate expression.

§

GroupedProjectionItemNotGrouped

ISO 14.11 requires every grouped non-aggregate projection item to be one of the grouping keys.

Fields

§span: SourceSpan

Source span of the invalid projection item.

§

ReturnStarRequiresInput

ISO 14.11 forbids RETURN * over a unit incoming binding table.

Fields

§span: SourceSpan

Source span of the invalid RETURN *.

§

SortKeyContainsNestedQuery

ISO 14.10 forbids nested query specifications inside sort keys.

Fields

§span: SourceSpan

Source span of the invalid sort key.

§

SortKeyContainsAggregate

ISO 14.10 restricts aggregate functions in post-RETURN sort keys.

Fields

§span: SourceSpan

Source span of the invalid sort key.

§

InvalidReference

A reference is syntactically resolved but not valid in this expression context.

Fields

§message: String

Human-readable rule failure.

§span: SourceSpan

Source span of the invalid reference.

§

RecursionLimitExceeded

Analyzer expression recursion exceeded the implementation-defined cap.

Fields

§depth: u32

Depth observed when the limit was exceeded.

§

TypeMismatch

A statically-decidable type mismatch.

Fields

§context: TypeMismatchContext

Operation or clause that required a different type.

§expected: ExpectedType

Expected type category.

§found: GqlType

Resolved type that violated the expectation.

§span: SourceSpan

Source span of the incompatible expression.

§

ConflictingParameterTypes

Conflicting inline types were declared for one parameter.

Fields

§name: DbString

Name without the leading $.

§declarations: Vec<(GqlType, SourceSpan)>

Conflicts in encounter order.

§

UnknownProcedure

Procedure name was not registered.

Fields

§name: Box<[DbString]>

Qualified procedure name.

§span: SourceSpan

Source span of the procedure call.

§

WrongArgumentCount

Procedure argument arity mismatch.

Fields

§procedure: Box<[DbString]>

Qualified procedure name.

§expected: usize

Maximum expected argument count.

§minimum: usize

Minimum expected argument count.

§actual: usize

Actual argument count.

§span: SourceSpan

Source span of the procedure call.

§

UnknownYieldColumn

YIELD col referenced a column not in the procedure output schema.

Fields

§procedure: Box<[DbString]>

Qualified procedure name.

§column: DbString

Requested output column.

§span: SourceSpan

Source span of the YIELD item.

§

MutatingProcedureInReadPipeline

A read-only pipeline invoked a procedure declared as graph-writing, schema-writing, or administrative.

Fields

§procedure: Box<[DbString]>

Qualified procedure name.

§mutability: ProcedureMutability

Declared procedure mutability.

§span: SourceSpan

Source span of the procedure call.

§

SchemaUnknownNodeType

Static closed-graph validation found no matching node type.

Fields

§labels: LabelSet

Observed static label set.

§graph_type: DbString

Bound graph type name.

§span: SourceSpan

Source span of the offending label expression or pattern.

§

SchemaUnknownEdgeType

Static closed-graph validation found no matching edge type.

Fields

§label: DbString

Edge label.

§graph_type: DbString

Bound graph type name.

§span: SourceSpan

Source span of the offending edge label.

§

SchemaEdgeEndpointMismatch

Static closed-graph validation found an edge endpoint mismatch.

Fields

§label: DbString

Edge label.

§expected_source: String

Expected source node type name.

§expected_target: String

Expected target node type name.

§observed_source: Box<LabelSet>

Observed source label set.

Boxed (together with observed_target) so this variant does not inflate AnalysisError past clippy’s result_large_err threshold: LabelSet wraps SmallVec<[DbString; 3]>, so two inline copies dominated the variant. The Box moves both onto the cold error-construction path.

§observed_target: Box<LabelSet>

Observed target label set. Boxed for the same reason as observed_source.

§span: SourceSpan

Source span of the offending edge pattern.

§

SchemaUndeclaredProperty

Static closed-graph validation found an undeclared property.

Fields

§property: DbString

Undeclared property key.

§declared_in: DbString

Node or edge type name that was checked.

§graph_type: DbString

Bound graph type name.

§span: SourceSpan

Source span of the property write.

§

SchemaPropertyTypeMismatch

Static closed-graph validation found a property value type mismatch.

Fields

§property: DbString

Property key.

§declared_in: DbString

Node or edge type name that declared the property.

§expected: PropertyValueType

Expected runtime storage type.

§found: GqlType

Statically inferred GQL type.

§span: SourceSpan

Source span of the offending value expression.

§

SchemaRequiredPropertyMissing

Static closed-graph validation found a missing required property.

Fields

§property: DbString

Required property key.

§declared_in: DbString

Node or edge type name that declared the property.

§span: SourceSpan

Source span of the insert pattern.

§

SchemaRequiredPropertyRemoved

Static closed-graph validation found a required property removal.

Fields

§property: DbString

Required property key.

§declared_in: DbString

Node or edge type name that declared the property.

§span: SourceSpan

Source span of the remove item.

§

SchemaInvalidInsertLabelExpr

Static closed-graph validation found an invalid INSERT label expression.

Fields

§form: InvalidLabelForm

Invalid label-expression form.

§span: SourceSpan

Source span of the invalid pattern.

§

SchemaRequiredEdgeLabelRemoved

Static closed-graph validation found removal of an edge’s required label.

Fields

§label: DbString

Required edge label.

§declared_in: DbString

Edge type name that declared the label.

§span: SourceSpan

Source span of the remove item.

Implementations§

Source§

impl AnalysisError

Source

pub const fn gqlstatus(&self) -> GqlStatus

Return this error’s ISO GQLSTATUS code.

Trait Implementations§

Source§

impl Debug for AnalysisError

Source§

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

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

impl Diagnostic for AnalysisError

Source§

fn code(&self) -> Option<Box<dyn Display + '_>>

Unique diagnostic code that can be used to look up more information about this Diagnostic. Ideally also globally unique, and documented in the toplevel crate’s documentation for easy searching. Rust path format (foo::bar::baz) is recommended, but more classic codes like E0123 or enums will work just fine.
Source§

fn help(&self) -> Option<Box<dyn Display + '_>>

Additional help text related to this Diagnostic. Do you have any advice for the poor soul who’s just run into this issue?
Source§

fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>

Labels to apply to this Diagnostic’s Diagnostic::source_code
Source§

fn severity(&self) -> Option<Severity>

Diagnostic severity. This may be used by ReportHandlers to change the display format of this diagnostic. Read more
Source§

fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>

URL to visit for a more detailed explanation/help about this Diagnostic.
Source§

fn source_code(&self) -> Option<&dyn SourceCode>

Source code to apply this Diagnostic’s Diagnostic::labels to.
Source§

fn related<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>>

Additional related Diagnostics.
Source§

fn diagnostic_source(&self) -> Option<&dyn Diagnostic>

The cause of the error.
Source§

impl Display for AnalysisError

Source§

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

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

impl Error for AnalysisError

1.30.0 · Source§

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

👎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, request: &mut Request<'a>)

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

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

Source§

fn to_string(&self) -> String

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more