Trait CodeGenerator

Source
pub trait CodeGenerator {
Show 17 methods // Required method fn fields_for_executable_struct( &self, executable_struct: &ExecutableStruct<'_>, ) -> Fields; // Provided methods fn attributes_for_executable_struct( &self, executable_struct: &ExecutableStruct<'_>, ) -> Vec<Attribute> { ... } fn additional_impls_for_executable_struct( &self, executable_struct: &ExecutableStruct<'_>, ) -> Vec<ItemImpl> { ... } fn attributes_for_executable_enum( &self, executable_enum: &ExecutableEnum<'_>, ) -> Vec<Attribute> { ... } fn additional_impls_for_executable_enum( &self, executable_enum: &ExecutableEnum<'_>, ) -> Vec<ItemImpl> { ... } fn attributes_for_executable_enum_variant( &self, executable_struct: &ExecutableStruct<'_>, ) -> Vec<Attribute> { ... } fn attributes_for_executable_enum_variant_other(&self) -> Vec<Attribute> { ... } fn attributes_for_enum( &self, enum_type_definition: &impl EnumTypeDefinition, ) -> Vec<Attribute> { ... } fn additional_impls_for_enum( &self, enum_type_definition: &impl EnumTypeDefinition, ) -> Vec<ItemImpl> { ... } fn attributes_for_enum_variant( &self, enum_value_definition: &impl EnumValueDefinition, ) -> Vec<Attribute> { ... } fn attributes_for_enum_variant_other(&self) -> Vec<Attribute> { ... } fn attributes_for_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<Attribute> { ... } fn additional_impls_for_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<ItemImpl> { ... } fn attributes_for_input_object_field( &self, input_value_definition: &impl InputValueDefinition, borrows: bool, ) -> Vec<Attribute> { ... } fn attributes_for_one_of_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<Attribute> { ... } fn additional_impls_for_one_of_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<ItemImpl> { ... } fn attributes_for_one_of_input_object_field( &self, input_value_definition: &impl InputValueDefinition, borrows: bool, ) -> Vec<Attribute> { ... }
}

Required Methods§

Source

fn fields_for_executable_struct( &self, executable_struct: &ExecutableStruct<'_>, ) -> Fields

Returns a syn::Fields struct that can be used to generate the fields of an executable struct.

Provided Methods§

Source

fn attributes_for_executable_struct( &self, executable_struct: &ExecutableStruct<'_>, ) -> Vec<Attribute>

Does not need to include the doc string attribute, that will be added automatically.

Source

fn additional_impls_for_executable_struct( &self, executable_struct: &ExecutableStruct<'_>, ) -> Vec<ItemImpl>

Any additional impl blocks for the executable struct.

Source

fn attributes_for_executable_enum( &self, executable_enum: &ExecutableEnum<'_>, ) -> Vec<Attribute>

Does not need to include the doc string attribute, that will be added automatically.

Source

fn additional_impls_for_executable_enum( &self, executable_enum: &ExecutableEnum<'_>, ) -> Vec<ItemImpl>

Any additional impl blocks for the executable enum.

Source

fn attributes_for_executable_enum_variant( &self, executable_struct: &ExecutableStruct<'_>, ) -> Vec<Attribute>

Does not need to include the doc string attribute, that will be added automatically.

Source

fn attributes_for_executable_enum_variant_other(&self) -> Vec<Attribute>

Any attributes for the Other variant that is added to all enums.

Source

fn attributes_for_enum( &self, enum_type_definition: &impl EnumTypeDefinition, ) -> Vec<Attribute>

Any attributes for the enum type definition. Does not need to include the doc string attribute, that will be added automatically.

Source

fn additional_impls_for_enum( &self, enum_type_definition: &impl EnumTypeDefinition, ) -> Vec<ItemImpl>

Any additional impl blocks for the enum type definition.

Source

fn attributes_for_enum_variant( &self, enum_value_definition: &impl EnumValueDefinition, ) -> Vec<Attribute>

Any attributes for the enum variant. Does not need to include the doc string attribute, that will be added automatically.

Source

fn attributes_for_enum_variant_other(&self) -> Vec<Attribute>

Any attributes for the Other variant that is added to all enums.

Source

fn attributes_for_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<Attribute>

Any attributes for the input object type definition. Does not need to include the doc string attribute, that will be added automatically. Note that this does not apply to @oneOf input objects, those will use the attributes_for_one_of_input_object method instead.

Source

fn additional_impls_for_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<ItemImpl>

Any additional impl blocks for the input object type definition. Note that this does not apply to @oneOf input objects, those will use the additional_impls_for_one_of_input_object method instead.

Source

fn attributes_for_input_object_field( &self, input_value_definition: &impl InputValueDefinition, borrows: bool, ) -> Vec<Attribute>

Any attributes for the input value definition. Does not need to include the doc string attribute, that will be added automatically.

Source

fn attributes_for_one_of_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<Attribute>

Any attributes for the @oneOf input object type definition. Does not need to include the doc string attribute, that will be added automatically.

Source

fn additional_impls_for_one_of_input_object( &self, input_object_type_definition: &impl InputObjectTypeDefinition, ) -> Vec<ItemImpl>

Any additional impl blocks for the @oneOf input object type definition.

Source

fn attributes_for_one_of_input_object_field( &self, input_value_definition: &impl InputValueDefinition, borrows: bool, ) -> Vec<Attribute>

Any attributes for the input value definition of a @oneOf input object. Does not need to include the doc string attribute, that will be added automatically.

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.

Implementors§