@@ -5,6 +5,9 @@ use crate::types::cgp_component::CgpComponentArgs;
55use crate :: types:: empty_struct:: EmptyStruct ;
66use crate :: types:: provider_impl:: { ItemProviderImpl , ItemProviderImpls } ;
77
8+ /// Final pipeline stage: all derived items, plus the args and attributes needed
9+ /// to render the standard provider impls (`UseContext`, `RedirectLookup`, and the
10+ /// per-attribute `UseDelegate`/prefix impls).
811pub struct EvaluatedCgpComponent {
912 pub component_struct : EmptyStruct ,
1013 pub consumer_trait : ItemTrait ,
@@ -16,6 +19,8 @@ pub struct EvaluatedCgpComponent {
1619}
1720
1821impl EvaluatedCgpComponent {
22+ /// Emit the five core items in fixed order (consumer trait, consumer impl,
23+ /// provider trait, provider impl, marker struct), then the provider impls.
1924 pub fn to_items ( & self ) -> syn:: Result < Vec < Item > > {
2025 let mut items = vec ! [
2126 Item :: Trait ( self . consumer_trait. clone( ) ) ,
@@ -55,6 +60,7 @@ impl EvaluatedCgpComponent {
5560 Ok ( provider_impls)
5661 }
5762
63+ /// One `UseDelegate` provider impl per `#[derive_delegate]` attribute.
5864 pub fn to_use_delegate_impls ( & self ) -> syn:: Result < ItemProviderImpls > {
5965 let provider_trait = & self . provider_trait ;
6066 let component_type = self . args . component_name . to_type ( ) ;
@@ -71,6 +77,7 @@ impl EvaluatedCgpComponent {
7177 Ok ( provider_impls)
7278 }
7379
80+ /// One namespace prefix impl per `#[prefix]` attribute (from `#[cgp_namespace]`).
7481 pub fn to_prefix_impls ( & self ) -> syn:: Result < Vec < ItemImpl > > {
7582 let component_name = & self . args . component_name ;
7683 let mut provider_impls = Vec :: new ( ) ;
0 commit comments