pub struct Config { /* private fields */ }
Expand description
Codegen configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn exhaustive(&mut self, exhaustive: bool) -> &mut Config
pub fn exhaustive(&mut self, exhaustive: bool) -> &mut Config
Controls exhaustive matchability of unions and enums.
Non-exhaustive unions and enums have the ability to deserialize and reserialize unknown variants. This enables clients to be more forward-compatible with changes made by newer servers.
Defaults to false
.
Sourcepub fn serialize_empty_collections(
&mut self,
serialize_empty_collections: bool,
) -> &mut Config
pub fn serialize_empty_collections( &mut self, serialize_empty_collections: bool, ) -> &mut Config
Controls serialization of empty collection fields in objects.
Some Conjure implementations don’t properly handle deserialization of objects when empty collections are omitted. Enabling this option will cause empty optional, set, list, and map fields to be included in the serialized output.
Defaults to false
.
Sourcepub fn use_legacy_error_serialization(
&mut self,
use_legacy_error_serialization: bool,
) -> &mut Config
pub fn use_legacy_error_serialization( &mut self, use_legacy_error_serialization: bool, ) -> &mut Config
Parameters of service errors were historically stringified when serialized into response bodies.
Setting this to false
will cause error parameters to be serialized directly as their underlying types would
be.
Defaults to true
.
Sourcepub fn strip_prefix<T>(&mut self, strip_prefix: T) -> &mut Config
pub fn strip_prefix<T>(&mut self, strip_prefix: T) -> &mut Config
Sets a prefix that will be stripped from package names.
Defaults to None
.
Sourcepub fn version<T>(&mut self, version: T) -> &mut Config
pub fn version<T>(&mut self, version: T) -> &mut Config
Sets the version included in endpoint metadata for generated client bindings.
Defaults to the version passed to Self::build_crate
, or None
otherwise.
Sourcepub fn extra_manifest_config<T>(&mut self, config: T) -> &mut Config
pub fn extra_manifest_config<T>(&mut self, config: T) -> &mut Config
Sets extra manifest configuration to be merged into the generated Cargo.toml.
Defaults to None
Sourcepub fn build_crate(&mut self, name: &str, version: &str) -> &mut Config
pub fn build_crate(&mut self, name: &str, version: &str) -> &mut Config
Switches generation to create a full crate.
Defaults to just generating a single module.