Module :: component_model_types
A flexible implementation of the Builder pattern supporting nested builders and collection-specific subcomponent_models
. Its compile-time structures and traits that are not generated but reused.
Example: Using Trait Assign
Demonstrates setting various components (fields) of a struct.
The component_model_types
crate provides a generic interface for setting components on an object. This example defines a Person
struct
and implements the Assign
trait for its fields. It shows how to use these implementations to set the fields of a Person
instance using different types that can be converted into the required types.
Try out cargo run --example component_model_types_trivial
.
See code.