pub trait Visitor<'a, E: ExecutableDocument, S: SchemaDefinition, V: VariableValues> {
type ExtraInfo;
// Required method
fn new(
operation_definition: &'a E::OperationDefinition,
schema_definition: &'a S,
variable_values: &'a V,
cache: &'a Cache<'a, E, S>,
extra_info: Self::ExtraInfo,
) -> Self;
// Provided methods
fn visit_variable_argument(
&mut self,
argument: &'a E::Argument<false>,
_input_value_definition: &'a S::InputValueDefinition,
) { ... }
fn visit_field(
&mut self,
field: &'a E::Field,
field_definition: &'a S::FieldDefinition,
scoped_type: TypeDefinitionReference<'a, S::TypeDefinition>,
included: bool,
) { ... }
fn leave_field(
&mut self,
field: &'a <E as ExecutableDocument>::Field,
field_definition: &'a S::FieldDefinition,
scoped_type: TypeDefinitionReference<'a, S::TypeDefinition>,
included: bool,
) { ... }
fn visit_variable_definition(
&mut self,
variable_definition: &'a E::VariableDefinition,
) { ... }
}Required Associated Types§
Required Methods§
fn new( operation_definition: &'a E::OperationDefinition, schema_definition: &'a S, variable_values: &'a V, cache: &'a Cache<'a, E, S>, extra_info: Self::ExtraInfo, ) -> Self
Provided Methods§
fn visit_variable_argument( &mut self, argument: &'a E::Argument<false>, _input_value_definition: &'a S::InputValueDefinition, )
Sourcefn visit_field(
&mut self,
field: &'a E::Field,
field_definition: &'a S::FieldDefinition,
scoped_type: TypeDefinitionReference<'a, S::TypeDefinition>,
included: bool,
)
fn visit_field( &mut self, field: &'a E::Field, field_definition: &'a S::FieldDefinition, scoped_type: TypeDefinitionReference<'a, S::TypeDefinition>, included: bool, )
Visits the field. If a field is part of a fragment definition, it will be visited every time the fragment is spread.
§Variables
fieldis the field being visitedfield_definitionis the definition of the fieldscoped_typeis the type that the field definition is defined withinincludedis true when the field is known to be included in the response (based on the usage of@includeand@skipdirectives and the variable values)
Sourcefn leave_field(
&mut self,
field: &'a <E as ExecutableDocument>::Field,
field_definition: &'a S::FieldDefinition,
scoped_type: TypeDefinitionReference<'a, S::TypeDefinition>,
included: bool,
)
fn leave_field( &mut self, field: &'a <E as ExecutableDocument>::Field, field_definition: &'a S::FieldDefinition, scoped_type: TypeDefinitionReference<'a, S::TypeDefinition>, included: bool, )
Called after the field and all of its children have been visited.
See visit_field for more information about the variables.
Sourcefn visit_variable_definition(
&mut self,
variable_definition: &'a E::VariableDefinition,
)
fn visit_variable_definition( &mut self, variable_definition: &'a E::VariableDefinition, )
Visits the variable definition.
§Variables
variable_definitionis the variable definition being visited
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.