pub struct Config {
pub parser: ParserConfig,
pub interpreter: InterpreterConfig,
pub optimizer: OptimizerConfig,
pub generator: GeneratorConfig,
pub renderer: RendererConfig,
}Expand description
Configuration structure for the generate method.
Fields§
§parser: ParserConfigConfiguration for the schema parser.
interpreter: InterpreterConfigConfiguration for the schema interpreter.
optimizer: OptimizerConfigConfiguration for the type information optimizer.
generator: GeneratorConfigConfiguration for the code generator.
renderer: RendererConfigConfiguration for the code renderer.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_schema(self, schema: Schema) -> Self
pub fn with_schema(self, schema: Schema) -> Self
Adds the passed schema to the list of schemas to parse.
Sourcepub fn with_schemas<I>(self, schemas: I) -> Selfwhere
I: IntoIterator<Item = Schema>,
pub fn with_schemas<I>(self, schemas: I) -> Selfwhere
I: IntoIterator<Item = Schema>,
Adds the passed schemas to the list of schemas to parse.
Sourcepub fn set_parser_flags(self, flags: ParserFlags) -> Self
pub fn set_parser_flags(self, flags: ParserFlags) -> Self
Set parser flags to the config.
Sourcepub fn with_parser_flags(self, flags: ParserFlags) -> Self
pub fn with_parser_flags(self, flags: ParserFlags) -> Self
Add parser flags to the config.
Sourcepub fn without_parser_flags(self, flags: ParserFlags) -> Self
pub fn without_parser_flags(self, flags: ParserFlags) -> Self
Remove parser flags to the config.
Sourcepub fn set_interpreter_flags(self, flags: InterpreterFlags) -> Self
pub fn set_interpreter_flags(self, flags: InterpreterFlags) -> Self
Set interpreter flags to the config.
Sourcepub fn with_interpreter_flags(self, flags: InterpreterFlags) -> Self
pub fn with_interpreter_flags(self, flags: InterpreterFlags) -> Self
Add code interpreter flags to the config.
Sourcepub fn without_interpreter_flags(self, flags: InterpreterFlags) -> Self
pub fn without_interpreter_flags(self, flags: InterpreterFlags) -> Self
Remove code interpreter flags to the config.
Sourcepub fn set_optimizer_flags(self, flags: OptimizerFlags) -> Self
pub fn set_optimizer_flags(self, flags: OptimizerFlags) -> Self
Set optimizer flags to the config.
Sourcepub fn with_optimizer_flags(self, flags: OptimizerFlags) -> Self
pub fn with_optimizer_flags(self, flags: OptimizerFlags) -> Self
Add optimizer flags to the config.
Sourcepub fn without_optimizer_flags(self, flags: OptimizerFlags) -> Self
pub fn without_optimizer_flags(self, flags: OptimizerFlags) -> Self
Remove optimizer flags to the config.
Sourcepub fn set_generator_flags(self, flags: GeneratorFlags) -> Self
pub fn set_generator_flags(self, flags: GeneratorFlags) -> Self
Set generator flags to the config.
Sourcepub fn with_generator_flags(self, flags: GeneratorFlags) -> Self
pub fn with_generator_flags(self, flags: GeneratorFlags) -> Self
Add code generator flags to the config.
Sourcepub fn without_generator_flags(self, flags: GeneratorFlags) -> Self
pub fn without_generator_flags(self, flags: GeneratorFlags) -> Self
Remove code generator flags to the config.
Sourcepub fn set_renderer_flags(self, flags: RendererFlags) -> Self
pub fn set_renderer_flags(self, flags: RendererFlags) -> Self
Set renderer flags to the config.
Sourcepub fn with_renderer_flags(self, flags: RendererFlags) -> Self
pub fn with_renderer_flags(self, flags: RendererFlags) -> Self
Add code renderer flags to the config.
Sourcepub fn without_renderer_flags(self, flags: RendererFlags) -> Self
pub fn without_renderer_flags(self, flags: RendererFlags) -> Self
Remove code renderer flags to the config.
Sourcepub fn set_box_flags(self, flags: BoxFlags) -> Self
pub fn set_box_flags(self, flags: BoxFlags) -> Self
Set boxing flags to the code generator config.
Sourcepub fn with_box_flags(self, flags: BoxFlags) -> Self
pub fn with_box_flags(self, flags: BoxFlags) -> Self
Add boxing flags to the code generator config.
Sourcepub fn without_box_flags(self, flags: BoxFlags) -> Self
pub fn without_box_flags(self, flags: BoxFlags) -> Self
Remove boxing flags to the code generator config.
Sourcepub fn with_render_step<T>(self, step: T) -> Selfwhere
T: RenderStepConfig + 'static,
pub fn with_render_step<T>(self, step: T) -> Selfwhere
T: RenderStepConfig + 'static,
Adds the passed step to the config.
If the same type of renderer was already added, it is replaced by the new one.
Sourcepub fn with_render_steps<I>(self, steps: I) -> Self
pub fn with_render_steps<I>(self, steps: I) -> Self
Add multiple renderers to the generator config.
See with_render_step for details.
Sourcepub fn with_quick_xml_serialize(self) -> Self
pub fn with_quick_xml_serialize(self) -> Self
Enable code generation for quick_xml serialization.
Sourcepub fn with_quick_xml_serialize_config(
self,
namespaces: NamespaceSerialization,
default_namespace: Option<Namespace>,
) -> Self
pub fn with_quick_xml_serialize_config( self, namespaces: NamespaceSerialization, default_namespace: Option<Namespace>, ) -> Self
Enable code generation for quick_xml serialization.
Sourcepub fn with_quick_xml_deserialize(self) -> Self
pub fn with_quick_xml_deserialize(self) -> Self
Enable code generation for quick_xml deserialization with the default settings.
Sourcepub fn with_quick_xml_deserialize_config(self, boxed_deserializer: bool) -> Self
pub fn with_quick_xml_deserialize_config(self, boxed_deserializer: bool) -> Self
Enable render steps for quick_xml deserialization
with the passed configuration.
Sourcepub fn with_quick_xml(self) -> Self
pub fn with_quick_xml(self) -> Self
Enable render steps for quick_xml serialization and deserialization
with the default settings.
Sourcepub fn with_quick_xml_config(
self,
namespace_serialization: NamespaceSerialization,
default_serialize_namespace: Option<Namespace>,
boxed_deserializer: bool,
) -> Self
pub fn with_quick_xml_config( self, namespace_serialization: NamespaceSerialization, default_serialize_namespace: Option<Namespace>, boxed_deserializer: bool, ) -> Self
Enable render steps for quick_xml serialization and deserialization
with the passed configuration.
Sourcepub fn with_serde_quick_xml(self) -> Self
pub fn with_serde_quick_xml(self) -> Self
Enable render steps for types with quick_xml serde support.
Sourcepub fn with_serde_xml_rs(self, version: SerdeXmlRsVersion) -> Self
pub fn with_serde_xml_rs(self, version: SerdeXmlRsVersion) -> Self
Enable render steps for types with quick_xml serde support.
Sourcepub fn with_generate<I>(self, types: I) -> Self
pub fn with_generate<I>(self, types: I) -> Self
Set the types the code should be generated for.
Sourcepub fn with_typedef_mode(self, mode: TypedefMode) -> Self
pub fn with_typedef_mode(self, mode: TypedefMode) -> Self
Set the typedef mode for the generator.
Sourcepub fn with_derive<I>(self, derive: I) -> Self
pub fn with_derive<I>(self, derive: I) -> Self
Set the traits the generated types should derive from.
Sourcepub fn with_any_type_support(self) -> Self
pub fn with_any_type_support(self) -> Self
Enable support for xs:any types.
Sourcepub fn with_any_types<S, T>(self, any_type: S, any_attributes_type: T) -> Self
pub fn with_any_types<S, T>(self, any_type: S, any_attributes_type: T) -> Self
Set the types to use to handle xs:any and xs:anyAttribute elements.
Sourcepub fn with_mixed_type_support(self) -> Self
pub fn with_mixed_type_support(self) -> Self
Enable support for mixed types.
Sourcepub fn with_mixed_types<S, T>(self, text_type: S, mixed_type: T) -> Self
pub fn with_mixed_types<S, T>(self, text_type: S, mixed_type: T) -> Self
Set the types to use to handle mixed types and text data.
Sourcepub fn with_nillable_type_support(self) -> Self
pub fn with_nillable_type_support(self) -> Self
Enable support for nillable types.
Sourcepub fn with_nillable_type<S>(self, nillable_type: S) -> Self
pub fn with_nillable_type<S>(self, nillable_type: S) -> Self
Set the type to use to handle nillable elements.
Sourcepub fn with_naming<X>(self, naming: X) -> Selfwhere
X: Naming + 'static,
pub fn with_naming<X>(self, naming: X) -> Selfwhere
X: Naming + 'static,
Set the Naming trait that is used to generated names in the interpreter.