pub struct GraphQLClientCodegenOptions {
    pub mode: CodegenMode,
    pub operation_name: Option<String>,
    pub struct_name: Option<String>,
    /* private fields */
}
Expand description

Used to configure code generation.

Fields§

§mode: CodegenMode

Which context is this code generation effort taking place.

§operation_name: Option<String>

Name of the operation we want to generate code for. If it does not match, we use all queries.

§struct_name: Option<String>

The name of implementation target struct.

Implementations§

source§

impl GraphQLClientCodegenOptions

source

pub fn new(mode: CodegenMode) -> GraphQLClientCodegenOptions

Creates an empty options object with default params. It probably wants to be configured.

source

pub fn set_query_file(&mut self, path: PathBuf)

A path to a file to include in the module to force Cargo to take into account changes in the query files when recompiling.

source

pub fn variables_derives(&self) -> Option<&str>

Comma-separated list of additional traits we want to derive for variables.

source

pub fn set_variables_derives(&mut self, variables_derives: String)

Comma-separated list of additional traits we want to derive for variables.

source

pub fn all_variable_derives(&self) -> impl Iterator<Item = &str>

All the variable derives to be rendered.

source

pub fn all_response_derives(&self) -> impl Iterator<Item = &str>

Traits we want to derive for responses.

source

pub fn additional_response_derives(&self) -> impl Iterator<Item = &str>

Additional traits we want to derive for responses.

source

pub fn set_response_derives(&mut self, response_derives: String)

Comma-separated list of additional traits we want to derive for responses.

source

pub fn set_deprecation_strategy( &mut self, deprecation_strategy: DeprecationStrategy )

The deprecation strategy to adopt.

source

pub fn set_module_visibility(&mut self, visibility: Visibility)

Target module visibility.

source

pub fn set_struct_name(&mut self, struct_name: String)

The name of implementation target struct.

source

pub fn set_operation_name(&mut self, operation_name: String)

Name of the operation we want to generate code for. If none is selected, it means all operations.

source

pub fn schema_file(&self) -> Option<&Path>

A path to a file to include in the module to force Cargo to take into account changes in the schema files when recompiling.

source

pub fn query_file(&self) -> Option<&Path>

A path to a file to include in the module to force Cargo to take into account changes in the query files when recompiling.

source

pub fn set_struct_ident(&mut self, ident: Ident)

The identifier to use when referring to the struct implementing GraphQLQuery, if any.

source

pub fn struct_ident(&self) -> Option<&Ident>

The identifier to use when referring to the struct implementing GraphQLQuery, if any.

source

pub fn set_normalization(&mut self, norm: Normalization)

Set the normalization mode for the generated code.

source

pub fn normalization(&self) -> &Normalization

The normalization mode for the generated code.

source

pub fn custom_scalars_module(&self) -> Option<&Path>

Get the custom scalar definitions module

source

pub fn set_custom_scalars_module(&mut self, module: Path)

Set the custom scalar definitions module

source

pub fn extern_enums(&self) -> &[String]

Get the externally defined enums type names

source

pub fn set_extern_enums(&mut self, enums: Vec<String>)

Set the externally defined enums type names

source

pub fn set_fragments_other_variant(&mut self, fragments_other_variant: bool)

Set the graphql client codegen options’s fragments other variant.

source

pub fn fragments_other_variant(&self) -> &bool

Get a reference to the graphql client codegen options’s fragments other variant.

source

pub fn set_skip_serializing_none(&mut self, skip_serializing_none: bool)

Set the graphql client codegen option’s skip none value.

source

pub fn skip_serializing_none(&self) -> &bool

Get a reference to the graphql client codegen option’s skip none value.

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

§

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

§

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.