Module renderer

Source
Expand description

Code rendering infrastructure for Rust type generation.

This module defines the Renderer and supporting components responsible for converting fully resolved DataTypes into structured Rust code modules. It provides a flexible, composable rendering pipeline through the RenderStep trait, allowing each rendering step to be added, removed, or customized as needed.

The Renderer can be extended with custom RenderStep implementations or modified using configuration methods such as flags(), derive(), and dyn_type_traits().

Example usage:

let module = Renderer::new(&types)
    .with_default_steps()
    .derive(["Debug", "Clone"])
    .finish();

Structs§

Context
Context for the rendering process.
DefaultsRenderStep
Implements a RenderStep that renders associated methods that return the default values of the different attributes and elements according to the schema.
MetaData
Meta data of the render process.
NamespaceConstantsRenderStep
Implements a RenderStep that renders constants for the different namespaces used in the schema.
QuickXmlDeserializeRenderStep
Implements a RenderStep that renders the code for the quick_xml deserialization.
QuickXmlSerializeRenderStep
Implements a RenderStep that renders the code for the quick_xml serialization.
Renderer
The Renderer is the central orchestrator for Rust code generation from resolved schema types.
SerdeQuickXmlTypesRenderStep
Implements a RenderStep that renders rust types of the types defined in the schema with quick-xml support.
SerdeXmlRsV7TypesRenderStep
Implements a RenderStep that renders rust types of the types defined in the schema with serde-xml-rs <= 0.7 support.
SerdeXmlRsV8TypesRenderStep
Implements a RenderStep that renders rust types of the types defined in the schema with serde-xml-rs >= 0.8 support.
TypesRenderStep
Implements a RenderStep that renders the actual rust types of the types defined in the schema.
WithNamespaceTraitRenderStep
Implements a RenderStep that renders the WithNamespace trait for each type defined in the schema.

Enums§

Error
Error that might be raised by the Generator.

Traits§

RenderStep
Trait that is used to define a renderer.