@@ -3,7 +3,7 @@ use frender_const::{ConstUsize, KnownConstUsizeAdd};
33use crate :: {
44 constness:: { HasConstKnownPossibleDomTokens , IsConstUsize } ,
55 dom_token:: UniqueDomTokenArrayVec ,
6- ChainableDomTokens , DomTokens , DomTokensStateUnmount ,
6+ ChainableDomTokens , DomTokens ,
77} ;
88
99#[ derive( Debug , Clone , Copy ) ]
@@ -24,85 +24,25 @@ where
2424 } ;
2525}
2626
27- impl < A : DomTokensStateUnmount , B : DomTokensStateUnmount > DomTokensStateUnmount for ( A , B ) {
28- fn dom_tokens_state_unmount (
29- ( state_a, state_b) : & mut Self ,
30- dom_token_list : & mut impl crate :: DomTokenList ,
31- ) {
32- A :: dom_tokens_state_unmount ( state_a, dom_token_list) ;
33- B :: dom_tokens_state_unmount ( state_b, dom_token_list) ;
34- }
27+ impl < A : ChainableDomTokens , B : ChainableDomTokens > crate :: sealed:: DomTokens for Chain < A , B > where
28+ Self : HasConstKnownPossibleDomTokens
29+ {
3530}
3631
37- impl < A : ChainableDomTokens , B : ChainableDomTokens > DomTokens for Chain < A , B >
38- where
39- Self : HasConstKnownPossibleDomTokens ,
32+ impl < A : ChainableDomTokens , B : ChainableDomTokens > DomTokens for Chain < A , B > where
33+ Self : HasConstKnownPossibleDomTokens
4034{
41- type State = ( A :: State , B :: State ) ;
42-
43- fn dom_tokens_render_init (
44- Self ( a, b) : Self ,
45- dom_token_list : & mut impl crate :: DomTokenList ,
46- ) -> Self :: State {
47- _ = Self :: ASSERT_KNOWN_NOT_DUP ;
48- (
49- A :: dom_tokens_render_init ( a, dom_token_list) ,
50- B :: dom_tokens_render_init ( b, dom_token_list) ,
51- )
52- }
53-
54- fn dom_tokens_render_init_with_old_state (
55- Self ( a, b) : Self ,
56- dom_token_list : & mut impl crate :: DomTokenList ,
57- ( old_state_a, old_state_b) : & mut Self :: State ,
58- ) {
59- _ = Self :: ASSERT_KNOWN_NOT_DUP ;
60- A :: dom_tokens_render_init_with_old_state ( a, dom_token_list, old_state_a) ;
61- B :: dom_tokens_render_init_with_old_state ( b, dom_token_list, old_state_b) ;
62- }
63-
64- fn dom_tokens_render_update (
65- Self ( a, b) : Self ,
66- dom_token_list : & mut impl crate :: DomTokenList ,
67- ( state_a, state_b) : & mut Self :: State ,
68- ) {
69- _ = Self :: ASSERT_KNOWN_NOT_DUP ;
70- A :: dom_tokens_render_update ( a, dom_token_list, state_a) ;
71- B :: dom_tokens_render_update ( b, dom_token_list, state_b) ;
72- }
73-
74- type DomTokensIntoAsyncStrIter = async_str_iter:: chain:: Chain <
75- A :: DomTokensIntoAsyncStrIter ,
76- B :: DomTokensPrefixSpaceIntoAsyncStrIter ,
77- > ;
78-
79- fn dom_tokens_into_async_str_iter ( Self ( a, b) : Self ) -> Self :: DomTokensIntoAsyncStrIter {
80- _ = Self :: ASSERT_KNOWN_NOT_DUP ;
81- async_str_iter:: chain:: Chain :: new (
82- A :: dom_tokens_into_async_str_iter ( a) ,
83- B :: dom_tokens_prefix_space_into_async_str_iter ( b) ,
84- )
85- }
8635}
8736
88- impl < A : ChainableDomTokens , B : ChainableDomTokens > ChainableDomTokens for Chain < A , B >
37+ impl < A : ChainableDomTokens , B : ChainableDomTokens > crate :: sealed:: ChainableDomTokens
38+ for crate :: Chain < A , B >
8939where
9040 Self : HasConstKnownPossibleDomTokens ,
9141{
92- type DomTokensPrefixSpaceIntoAsyncStrIter = async_str_iter:: chain:: Chain <
93- A :: DomTokensPrefixSpaceIntoAsyncStrIter ,
94- B :: DomTokensPrefixSpaceIntoAsyncStrIter ,
95- > ;
96-
97- fn dom_tokens_prefix_space_into_async_str_iter (
98- Self ( a, b) : Self ,
99- ) -> Self :: DomTokensPrefixSpaceIntoAsyncStrIter {
100- _ = Self :: ASSERT_KNOWN_NOT_DUP ;
101- async_str_iter:: chain:: Chain :: new (
102- A :: dom_tokens_prefix_space_into_async_str_iter ( a) ,
103- B :: dom_tokens_prefix_space_into_async_str_iter ( b) ,
104- )
105- }
42+ }
43+ impl < A : ChainableDomTokens , B : ChainableDomTokens > ChainableDomTokens for Chain < A , B > where
44+ Self : HasConstKnownPossibleDomTokens
45+ {
10646}
10747
10848impl <
@@ -126,3 +66,111 @@ where
12666 )
12767 } ;
12868}
69+
70+ #[ cfg( feature = "csr" ) ]
71+ mod csr {
72+ use crate :: {
73+ constness:: HasConstKnownPossibleDomTokens ,
74+ csr:: { CsrDomTokens , DomTokenList , DomTokensStateUnmount } ,
75+ ChainableDomTokens ,
76+ } ;
77+
78+ use super :: Chain ;
79+
80+ impl < A : DomTokensStateUnmount , B : DomTokensStateUnmount > DomTokensStateUnmount for ( A , B ) {
81+ fn dom_tokens_state_unmount (
82+ ( state_a, state_b) : & mut Self ,
83+ dom_token_list : & mut impl DomTokenList ,
84+ ) {
85+ A :: dom_tokens_state_unmount ( state_a, dom_token_list) ;
86+ B :: dom_tokens_state_unmount ( state_b, dom_token_list) ;
87+ }
88+ }
89+
90+ impl < A : ChainableDomTokens , B : ChainableDomTokens > CsrDomTokens for Chain < A , B >
91+ where
92+ Self : HasConstKnownPossibleDomTokens ,
93+ {
94+ type State = ( A :: State , B :: State ) ;
95+
96+ fn dom_tokens_render_init (
97+ Self ( a, b) : Self ,
98+ dom_token_list : & mut impl DomTokenList ,
99+ ) -> Self :: State {
100+ _ = Self :: ASSERT_KNOWN_NOT_DUP ;
101+ (
102+ A :: dom_tokens_render_init ( a, dom_token_list) ,
103+ B :: dom_tokens_render_init ( b, dom_token_list) ,
104+ )
105+ }
106+
107+ fn dom_tokens_render_init_with_old_state (
108+ Self ( a, b) : Self ,
109+ dom_token_list : & mut impl DomTokenList ,
110+ ( old_state_a, old_state_b) : & mut Self :: State ,
111+ ) {
112+ _ = Self :: ASSERT_KNOWN_NOT_DUP ;
113+ A :: dom_tokens_render_init_with_old_state ( a, dom_token_list, old_state_a) ;
114+ B :: dom_tokens_render_init_with_old_state ( b, dom_token_list, old_state_b) ;
115+ }
116+
117+ fn dom_tokens_render_update (
118+ Self ( a, b) : Self ,
119+ dom_token_list : & mut impl DomTokenList ,
120+ ( state_a, state_b) : & mut Self :: State ,
121+ ) {
122+ _ = Self :: ASSERT_KNOWN_NOT_DUP ;
123+ A :: dom_tokens_render_update ( a, dom_token_list, state_a) ;
124+ B :: dom_tokens_render_update ( b, dom_token_list, state_b) ;
125+ }
126+ }
127+ }
128+
129+ #[ cfg( feature = "ssr" ) ]
130+ mod ssr {
131+ use crate :: {
132+ constness:: HasConstKnownPossibleDomTokens ,
133+ ssr:: { SsrChainableDomTokens , SsrDomTokens } ,
134+ ChainableDomTokens ,
135+ } ;
136+
137+ use super :: Chain ;
138+
139+ impl < A : ChainableDomTokens , B : ChainableDomTokens > SsrDomTokens for Chain < A , B >
140+ where
141+ Self : HasConstKnownPossibleDomTokens ,
142+ {
143+ type DomTokensIntoAsyncStrIter = async_str_iter:: chain:: Chain <
144+ A :: DomTokensIntoAsyncStrIter ,
145+ B :: DomTokensPrefixSpaceIntoAsyncStrIter ,
146+ > ;
147+
148+ fn dom_tokens_into_async_str_iter ( Self ( a, b) : Self ) -> Self :: DomTokensIntoAsyncStrIter {
149+ _ = Self :: ASSERT_KNOWN_NOT_DUP ;
150+ async_str_iter:: chain:: Chain :: new (
151+ A :: dom_tokens_into_async_str_iter ( a) ,
152+ B :: dom_tokens_prefix_space_into_async_str_iter ( b) ,
153+ )
154+ }
155+ }
156+
157+ impl < A : ChainableDomTokens , B : ChainableDomTokens > SsrChainableDomTokens for Chain < A , B >
158+ where
159+ Self : HasConstKnownPossibleDomTokens ,
160+ {
161+ type DomTokensPrefixSpaceIntoAsyncStrIter = async_str_iter:: chain:: Chain <
162+ A :: DomTokensPrefixSpaceIntoAsyncStrIter ,
163+ B :: DomTokensPrefixSpaceIntoAsyncStrIter ,
164+ > ;
165+
166+ fn dom_tokens_prefix_space_into_async_str_iter (
167+ Self ( a, b) : Self ,
168+ ) -> Self :: DomTokensPrefixSpaceIntoAsyncStrIter {
169+ _ = Self :: ASSERT_KNOWN_NOT_DUP ;
170+ async_str_iter:: chain:: Chain :: new (
171+ A :: dom_tokens_prefix_space_into_async_str_iter ( a) ,
172+ B :: dom_tokens_prefix_space_into_async_str_iter ( b) ,
173+ )
174+ }
175+ }
176+ }
0 commit comments