-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Milestone
Description
Summary
With trait-generic providers like UseDelegate
, it is common to have nested delegation of components. However, the current design of delegate_components!
require the nested components to be defined with separate struct definitions and delegation.
New Syntax
The new delegate_components!
macro would support nested delegation with the following syntax:
pub struct FooComponents;
delegate_components! {
FooComponents {
FooOneComponent: FooOneImpl,
FooTwoComponent: UseDelegate<BarComponents {
BarOneComponent: BarOneImpl,
BarTwoComponent: BarTwoImpl,
}>,
}
}
Which would roughly expanded into the current syntax:
pub struct FooComponents;
pub struct BarComponents;
delegate_components! {
FooComponents {
FooOneComponent: FooOneImpl,
FooTwoComponent: UseDelegate<BarComponents>,
}
}
delegate_components! {
BarComponents {
BarOneComponent: BarOneImpl,
BarTwoComponent: BarTwoImpl,
}
}
Metadata
Metadata
Assignees
Labels
No labels