pub struct GenerationSettings { /* private fields */ }
Expand description
Settings for Generator.
Implementations§
Source§impl GenerationSettings
impl GenerationSettings
Sourcepub fn with_interface(&mut self, interface: InterfaceStyle) -> &mut Self
pub fn with_interface(&mut self, interface: InterfaceStyle) -> &mut Self
Set the InterfaceStyle.
Sourcepub fn with_inner_type(&mut self, inner_type: TokenStream) -> &mut Self
pub fn with_inner_type(&mut self, inner_type: TokenStream) -> &mut Self
Client inner type available to pre and post hooks.
Sourcepub fn with_pre_hook(&mut self, pre_hook: TokenStream) -> &mut Self
pub fn with_pre_hook(&mut self, pre_hook: TokenStream) -> &mut Self
Hook invoked before issuing the HTTP request.
Sourcepub fn with_pre_hook_async(&mut self, pre_hook: TokenStream) -> &mut Self
pub fn with_pre_hook_async(&mut self, pre_hook: TokenStream) -> &mut Self
Hook invoked before issuing the HTTP request.
Sourcepub fn with_post_hook(&mut self, post_hook: TokenStream) -> &mut Self
pub fn with_post_hook(&mut self, post_hook: TokenStream) -> &mut Self
Hook invoked prior to receiving the HTTP response.
Sourcepub fn with_post_hook_async(&mut self, post_hook: TokenStream) -> &mut Self
pub fn with_post_hook_async(&mut self, post_hook: TokenStream) -> &mut Self
Hook invoked prior to receiving the HTTP response.
Sourcepub fn with_derive(&mut self, derive: impl ToString) -> &mut Self
pub fn with_derive(&mut self, derive: impl ToString) -> &mut Self
Additional derive macros applied to generated types.
Sourcepub fn with_patch<S: AsRef<str>>(
&mut self,
type_name: S,
patch: &TypePatch,
) -> &mut Self
pub fn with_patch<S: AsRef<str>>( &mut self, type_name: S, patch: &TypePatch, ) -> &mut Self
Modify a type with the given name. See typify::TypeSpaceSettings::with_patch.
Sourcepub fn with_replacement<TS: ToString, RS: ToString, I: Iterator<Item = TypeImpl>>(
&mut self,
type_name: TS,
replace_name: RS,
impls: I,
) -> &mut Self
pub fn with_replacement<TS: ToString, RS: ToString, I: Iterator<Item = TypeImpl>>( &mut self, type_name: TS, replace_name: RS, impls: I, ) -> &mut Self
Replace a referenced type with a named type. See typify::TypeSpaceSettings::with_replacement.
Sourcepub fn with_conversion<S: ToString, I: Iterator<Item = TypeImpl>>(
&mut self,
schema: SchemaObject,
type_name: S,
impls: I,
) -> &mut Self
pub fn with_conversion<S: ToString, I: Iterator<Item = TypeImpl>>( &mut self, schema: SchemaObject, type_name: S, impls: I, ) -> &mut Self
Replace a given schema with a named type. See typify::TypeSpaceSettings::with_conversion.
Sourcepub fn with_unknown_crates(&mut self, policy: UnknownPolicy) -> &mut Self
pub fn with_unknown_crates(&mut self, policy: UnknownPolicy) -> &mut Self
Policy regarding crates referenced by the schema extension
x-rust-type
not explicitly specified via Self::with_crate.
See typify::TypeSpaceSettings::with_unknown_crates.
Sourcepub fn with_crate<S1: ToString>(
&mut self,
crate_name: S1,
version: CrateVers,
rename: Option<&String>,
) -> &mut Self
pub fn with_crate<S1: ToString>( &mut self, crate_name: S1, version: CrateVers, rename: Option<&String>, ) -> &mut Self
Explicitly named crates whose types may be used during generation rather than generating new types based on their schemas (base on the presence of the x-rust-type extension). See typify::TypeSpaceSettings::with_crate.
Sourcepub fn with_map_type<MT: ToString>(&mut self, map_type: MT) -> &mut Self
pub fn with_map_type<MT: ToString>(&mut self, map_type: MT) -> &mut Self
Set the type used for key-value maps. Common examples:
The requiremnets for a map type can be found in the typify::TypeSpaceSettings::with_map_type documentation.
Trait Implementations§
Source§impl Clone for GenerationSettings
impl Clone for GenerationSettings
Source§fn clone(&self) -> GenerationSettings
fn clone(&self) -> GenerationSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more