Struct UniqueVariableNames

Source
pub struct UniqueVariableNames<'a> { /* private fields */ }
Expand description

Validates that no operation the document defines has duplicate variable names in its variable definitions.

See ValidationRule Reference

Trait Implementations§

Source§

impl<'a> Default for UniqueVariableNames<'a>

Source§

fn default() -> UniqueVariableNames<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> ValidationRule<'a> for UniqueVariableNames<'a>

Source§

fn validate(ctx: &'a ASTContext, document: &'a Document<'a>) -> Result<()>

Run this ValidationRule against the given document and return a result which errors if the rule fails on the document.
Source§

impl<'a> Visitor<'a, ValidationContext<'a>> for UniqueVariableNames<'a>

Source§

fn enter_operation( &mut self, _ctx: &mut ValidationContext<'a>, _operation: &'a OperationDefinition<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when an OperationDefinition node is visited and before its child nodes are visited.
Source§

fn enter_variable_definition( &mut self, ctx: &mut ValidationContext<'a>, var_def: &'a VariableDefinition<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when a VariableDefinition node is visited and before its child nodes are visited.
Source§

fn enter_selection_set( &mut self, _ctx: &mut ValidationContext<'a>, _selection_set: &'a SelectionSet<'_>, _info: &VisitInfo, ) -> VisitFlow

Called when a SelectionSet node is visited and before its child nodes are visited.
Source§

fn enter_directive( &mut self, _ctx: &mut ValidationContext<'a>, _fragment: &'a Directive<'_>, _info: &VisitInfo, ) -> VisitFlow

Called when a Directive node is visited and before its child nodes are visited.
Source§

fn enter_fragment( &mut self, _ctx: &mut ValidationContext<'a>, _fragment: &'a FragmentDefinition<'_>, _info: &VisitInfo, ) -> VisitFlow

Called when a FragmentDefinition node is visited and before its child nodes are visited.
Source§

fn compose<V: Visitor<'a, Context>>( self, other: V, ) -> ComposedVisitor<'a, Context, Self, V>

Combines two visitors into one that will run both the original and passed visitor concurrently. Read more
Source§

fn enter_document( &mut self, _ctx: &mut Context, _document: &'a Document<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when a Document is visited and before its child nodes are visited.
Source§

fn leave_document( &mut self, _ctx: &mut Context, _document: &'a Document<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a Document and its child nodes were visited.
Source§

fn leave_operation( &mut self, _ctx: &mut Context, _operation: &'a OperationDefinition<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after an OperationDefinition and its child node were visited.
Source§

fn leave_fragment( &mut self, _ctx: &mut Context, _fragment: &'a FragmentDefinition<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a FragmentDefinition node and its child nodes were visited.
Source§

fn leave_variable_definition( &mut self, _ctx: &mut Context, _var_def: &'a VariableDefinition<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a VariableDefinition node and its child nodes were visited.
Source§

fn leave_selection_set( &mut self, _ctx: &mut Context, _selection_set: &'a SelectionSet<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a SelectionSet node and its child nodes were visited.
Source§

fn enter_fragment_spread( &mut self, _ctx: &mut Context, _fragment_spread: &'a FragmentSpread<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when a FragmentSpread node is visited and before its child nodes are visited.
Source§

fn leave_fragment_spread( &mut self, _ctx: &mut Context, _fragment_spread: &'a FragmentSpread<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a FragmentSpread node and its child nodes were visited.
Source§

fn enter_inline_fragment( &mut self, _ctx: &mut Context, _inline_fragment: &'a InlineFragment<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when an InlineFragment node is visited and before its child nodes are visited.
Source§

fn leave_inline_fragment( &mut self, _ctx: &mut Context, _inline_fragment: &'a InlineFragment<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after an InlineFragment node and its child nodes were visited.
Source§

fn enter_field( &mut self, _ctx: &mut Context, _field: &'a Field<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when a Field node is visited and before its child nodes are visited.
Source§

fn leave_field( &mut self, _ctx: &mut Context, _field: &'a Field<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a Field node and its child nodes were visited.
Source§

fn leave_directive( &mut self, _ctx: &mut Context, _directive: &'a Directive<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after a Directive node and its child nodes were visited.
Source§

fn enter_argument( &mut self, _ctx: &mut Context, _argument: &'a Argument<'a>, _info: &VisitInfo, ) -> VisitFlow

Called when an Argument node is visited and before its child nodes are visited.
Source§

fn leave_argument( &mut self, _ctx: &mut Context, _argument: &'a Argument<'a>, _info: &VisitInfo, ) -> VisitFlow

Called after an Argument node and its child nodes were visited.

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