Expand description
Core traits for the builderx DSL (builder-pattern adapters).
These traits define how the bx! macro talks to concrete UI toolkits. Adapters
bridge between a generic builder syntax and a specific “attach child/children”
API that each toolkit exposes.
§Picking an integration style
- If you control the builder type (or it already has attach semantics), implement
AttachChild/AttachChildrenand useDefaultAdapterfor the most ergonomic path—no adapter type needed. - If the builder is foreign or needs custom glue, implement
BxAdapter+CanAttach/CanAttachManyon a small adapter type instead.
Structs§
- Default
Adapter - Default adapter that delegates to
AttachChild/AttachChildren. Use this when your builder already implements those extension traits.
Traits§
- Attach
Child - Trait for builders that can accept a single child value. Implement this on your toolkit’s builder type when you want to opt into the default adapter.
- Attach
Children - Trait for builders that can accept an iterator of child values. Implement
alongside
AttachChildto handle spread (..iter) children efficiently. - BxAdapter
- Adapter hook to make the builder DSL agnostic to concrete APIs.
- CanAttach
- Marker/behavior for adapter-specific single-child support.
- CanAttach
Many - Marker/behavior for adapter-specific multi-child support.