Made scope back to Mutex due to performance

This commit is contained in:
2026-01-31 17:45:14 +01:00
parent 1f566e19e7
commit 04f2abc47a
4 changed files with 260 additions and 334 deletions
+225 -225
View File
@@ -1,227 +1,227 @@
Iterx72,Nestingx72,Time µs Iterx72,Nestingx72,Time µs
14,14,12797 14,14,15500
14,12,11775 0,8,534
1,5,1413 9,0,635
4,4,3773 11,4,2921
14,9,11790 9,4,2321
1,6,1364 9,2,2328
9,2,7869 2,7,963
0,6,658 4,3,1326
6,1,5264 6,12,2494
13,7,11002 14,8,3317
3,5,2904 12,12,2926
6,2,5217 8,0,614
9,6,7804 10,9,2530
14,10,11650 0,5,713
8,10,7484 4,12,1354
8,4,7097 8,2,2136
11,5,9290 10,5,2519
10,2,8451 14,4,3311
0,3,818 14,14,3368
10,11,8478 12,4,2938
7,9,6120 14,2,3273
5,4,4454 2,12,929
12,12,11135 9,3,2354
9,13,7693 1,1,786
1,3,1370 12,13,2884
7,3,6016 4,9,1336
1,9,1362 5,9,1557
13,6,10852 3,6,1153
12,1,10057 0,12,556
7,5,6434 13,6,3336
11,11,9395 3,10,1130
0,4,718 7,0,617
5,11,4543 7,11,1919
8,6,7230 0,0,1501
13,10,11024 0,1,1112
6,4,5464 5,2,1637
14,0,648 11,3,2713
5,8,4812 1,11,725
5,2,4877 7,5,1934
9,14,7750 4,11,1353
13,3,10860 3,1,1140
3,14,2977 10,12,2524
10,7,8500 14,3,3316
5,7,4498 8,11,2144
2,8,2172 0,7,633
14,4,11521 11,8,2741
3,3,2953 2,3,968
10,4,8542 3,8,1121
4,11,3705 12,14,3113
3,6,2935 13,1,3096
12,2,10065 13,4,3106
7,2,6218 14,11,3297
1,14,1366 1,2,708
8,3,6908 13,3,3090
0,2,949 6,4,1747
12,11,10240 11,11,2740
9,1,7942 10,8,2567
13,12,11014 7,7,1936
2,6,2166 4,6,1349
1,8,1372 3,7,1149
2,9,2157 1,7,750
4,2,3742 10,3,2585
11,14,9328 12,0,615
12,9,10376 10,13,2584
6,14,5787 3,9,1186
0,1,1139 14,10,3393
13,1,10823 2,4,943
6,6,5260 13,5,3090
13,13,11246 14,0,610
1,7,1395 5,14,1528
0,14,530 11,6,2764
2,7,2194 14,13,3268
3,9,2985 13,2,3105
14,5,11736 4,7,1375
14,6,11742 0,2,824
5,14,4436 13,13,3093
9,7,7881 6,7,1742
6,10,5276 2,2,941
6,11,5353 8,1,2165
4,8,3743 11,0,614
1,0,744 12,5,2971
10,14,8673 4,5,1337
4,3,3786 7,8,1923
8,11,7193 7,3,2124
9,0,659 10,1,2513
11,3,9316 1,10,715
8,12,6900 2,8,935
6,3,5313 7,14,1940
5,5,4484 5,5,1543
8,1,7013 1,6,720
3,11,2952 8,10,2144
4,1,3693 6,8,1729
8,8,6802 13,14,3127
9,3,7787 10,0,613
6,0,677 2,0,616
10,3,8730 5,13,1568
3,8,3035 8,5,2157
8,5,7176 7,4,1947
7,8,6104 7,13,1957
3,1,2946 9,5,2323
2,11,2174 0,3,895
3,13,2974 0,11,549
3,2,2957 14,7,3303
2,4,2193 8,6,2171
14,3,11935 10,10,2521
14,11,11743 14,12,3344
7,4,6073 4,10,1362
6,14,1758
1,3,723
7,12,1940
4,0,614
11,7,2727
6,11,2908
3,14,1136
13,8,3496
12,10,2962
2,9,925
2,5,936
9,6,2371
5,6,1567
2,10,935
9,7,2340
4,14,1328
1,12,720
8,12,2132
6,9,15000
8,8,2293
9,1,2364
2,14,965
12,8,2909
11,12,2750
13,0,628
13,12,3124
1,8,710
3,4,1133
12,9,2927
14,1,3317
3,5,1140
8,7,2149
7,2,2000
0,9,524 0,9,524
11,6,9238 10,2,2515
4,14,3742 11,5,2834
7,7,6195 9,14,2347
3,10,3034 2,6,927
0,7,606 9,9,2348
14,8,11580 13,7,3137
9,8,7825 4,1,1462
12,8,10017 11,2,2736
11,7,9449 5,11,1535
13,11,11607 11,14,2751
6,9,5274 12,11,2899
10,12,8370 5,10,1559
8,0,636 12,7,2915
8,2,7010 5,12,1551
0,13,535 3,12,1138
11,12,9348 11,1,2719
6,5,5280 11,13,2736
9,5,7846 6,6,1787
3,4,2927 5,3,1552
4,5,3766 8,4,2128
9,11,7779 1,5,721
10,10,8455 4,4,1357
10,5,8521 3,2,1136
2,1,2207 4,8,1326
2,2,2150 1,13,723
1,1,1527 14,5,3505
10,13,8667 6,0,607
7,10,6194 12,6,2897
5,12,4485 6,5,1706
4,9,3764 14,6,3357
12,4,9852 8,3,2194
11,0,641 6,3,1762
4,12,3821 5,4,1613
12,3,10057 0,10,522
11,2,9288 7,9,1954
5,0,637 11,9,2745
7,12,6402 3,11,1132
14,1,11986 5,0,620
2,3,2141 6,13,2016
11,9,9388 8,13,2146
12,13,10279 13,11,3138
4,0,635 13,10,3120
7,6,6145 11,10,2789
7,11,6310 0,13,536
0,10,527 1,9,718
12,6,10391 13,9,3090
14,14,12297 10,11,2511
13,4,11124 12,2,2937
14,7,11840 7,10,1909
0,11,558 7,6,1929
10,8,8604 5,7,1573
4,13,3859 1,14,747
5,13,4486 10,7,2584
0,12,522 3,13,1137
7,13,6051 0,14,525
13,2,10971 10,4,2534
13,5,11374 7,1,1978
7,1,6133 5,1,1583
9,10,7755 8,9,2130
9,9,7747 12,1,2913
11,13,9282 5,8,1538
4,10,3737 6,10,6557
13,0,653 10,6,2528
5,6,4578 2,1,929
4,6,3921 3,0,610
4,7,3704 2,13,930
10,0,642 6,1,1751
1,12,1362 9,8,2468
3,0,661 6,2,1725
3,7,2986 4,2,1400
10,1,8607 8,14,2143
10,6,8538 12,3,2950
11,8,9260 1,0,633
5,3,4441 9,10,2374
14,13,11718 3,3,1132
5,10,4507 10,14,2509
6,8,5576 0,4,964
12,5,10427 9,11,2337
6,7,5226 4,13,1376
12,7,10218 0,6,596
5,1,4923 1,4,733
9,12,8258 9,13,2363
8,9,7006 14,9,3278
2,0,650 2,11,916
8,7,6943 9,12,2339
12,0,645
2,5,2192
7,14,6478
11,1,9436
10,9,8658
1,4,1355
2,13,2165
1,11,1388
3,12,2931
2,10,2162
7,0,638
1,2,1384
8,14,6945
1,13,1349
0,8,602
8,13,7151
6,12,5362
11,4,9381
12,14,10160
13,9,10754
5,9,4437
0,5,694
12,10,10466
1,10,1362
9,4,7532
13,8,11058
13,14,11414
2,12,2166
6,13,5332
0,0,1190
11,10,9264
2,14,2172
14,2,11901
1 Iterx72 Nestingx72 Time µs
2 14 14 12797 15500
3 14 0 12 8 11775 534
4 1 9 5 0 1413 635
5 4 11 4 3773 2921
6 14 9 9 4 11790 2321
7 1 9 6 2 1364 2328
8 9 2 2 7 7869 963
9 0 4 6 3 658 1326
10 6 1 12 5264 2494
11 13 14 7 8 11002 3317
12 3 12 5 12 2904 2926
13 6 8 2 0 5217 614
14 9 10 6 9 7804 2530
15 14 0 10 5 11650 713
16 8 4 10 12 7484 1354
17 8 4 2 7097 2136
18 11 10 5 9290 2519
19 10 14 2 4 8451 3311
20 0 14 3 14 818 3368
21 10 12 11 4 8478 2938
22 7 14 9 2 6120 3273
23 5 2 4 12 4454 929
24 12 9 12 3 11135 2354
25 9 1 13 1 7693 786
26 1 12 3 13 1370 2884
27 7 4 3 9 6016 1336
28 1 5 9 1362 1557
29 13 3 6 10852 1153
30 12 0 1 12 10057 556
31 7 13 5 6 6434 3336
32 11 3 11 10 9395 1130
33 0 7 4 0 718 617
34 5 7 11 4543 1919
35 8 0 6 0 7230 1501
36 13 0 10 1 11024 1112
37 6 5 4 2 5464 1637
38 14 11 0 3 648 2713
39 5 1 8 11 4812 725
40 5 7 2 5 4877 1934
41 9 4 14 11 7750 1353
42 13 3 3 1 10860 1140
43 3 10 14 12 2977 2524
44 10 14 7 3 8500 3316
45 5 8 7 11 4498 2144
46 2 0 8 7 2172 633
47 14 11 4 8 11521 2741
48 3 2 3 2953 968
49 10 3 4 8 8542 1121
50 4 12 11 14 3705 3113
51 3 13 6 1 2935 3096
52 12 13 2 4 10065 3106
53 7 14 2 11 6218 3297
54 1 14 2 1366 708
55 8 13 3 6908 3090
56 0 6 2 4 949 1747
57 12 11 11 10240 2740
58 9 10 1 8 7942 2567
59 13 7 12 7 11014 1936
60 2 4 6 2166 1349
61 1 3 8 7 1372 1149
62 2 1 9 7 2157 750
63 4 10 2 3 3742 2585
64 11 12 14 0 9328 615
65 12 10 9 13 10376 2584
66 6 3 14 9 5787 1186
67 0 14 1 10 1139 3393
68 13 2 1 4 10823 943
69 6 13 6 5 5260 3090
70 13 14 13 0 11246 610
71 1 5 7 14 1395 1528
72 0 11 14 6 530 2764
73 2 14 7 13 2194 3268
74 3 13 9 2 2985 3105
75 14 4 5 7 11736 1375
76 14 0 6 2 11742 824
77 5 13 14 13 4436 3093
78 9 6 7 7881 1742
79 6 2 10 2 5276 941
80 6 8 11 1 5353 2165
81 4 11 8 0 3743 614
82 1 12 0 5 744 2971
83 10 4 14 5 8673 1337
84 4 7 3 8 3786 1923
85 8 7 11 3 7193 2124
86 9 10 0 1 659 2513
87 11 1 3 10 9316 715
88 8 2 12 8 6900 935
89 6 7 3 14 5313 1940
90 5 5 4484 1543
91 8 1 1 6 7013 720
92 3 8 11 10 2952 2144
93 4 6 1 8 3693 1729
94 8 13 8 14 6802 3127
95 9 10 3 0 7787 613
96 6 2 0 677 616
97 10 5 3 13 8730 1568
98 3 8 8 5 3035 2157
99 8 7 5 4 7176 1947
100 7 8 13 6104 1957
101 3 9 1 5 2946 2323
102 2 0 11 3 2174 895
103 3 0 13 11 2974 549
104 3 14 2 7 2957 3303
105 2 8 4 6 2193 2171
106 14 10 3 10 11935 2521
107 14 11 12 11743 3344
108 7 4 4 10 6073 1362
109 6 14 1758
110 1 3 723
111 7 12 1940
112 4 0 614
113 11 7 2727
114 6 11 2908
115 3 14 1136
116 13 8 3496
117 12 10 2962
118 2 9 925
119 2 5 936
120 9 6 2371
121 5 6 1567
122 2 10 935
123 9 7 2340
124 4 14 1328
125 1 12 720
126 8 12 2132
127 6 9 15000
128 8 8 2293
129 9 1 2364
130 2 14 965
131 12 8 2909
132 11 12 2750
133 13 0 628
134 13 12 3124
135 1 8 710
136 3 4 1133
137 12 9 2927
138 14 1 3317
139 3 5 1140
140 8 7 2149
141 7 2 2000
142 0 9 524
143 11 10 6 2 9238 2515
144 4 11 14 5 3742 2834
145 7 9 7 14 6195 2347
146 3 2 10 6 3034 927
147 0 9 7 9 606 2348
148 14 13 8 7 11580 3137
149 9 4 8 1 7825 1462
150 12 11 8 2 10017 2736
151 11 5 7 11 9449 1535
152 13 11 11 14 11607 2751
153 6 12 9 11 5274 2899
154 10 5 12 10 8370 1559
155 8 12 0 7 636 2915
156 8 5 2 12 7010 1551
157 0 3 13 12 535 1138
158 11 12 1 9348 2719
159 6 11 5 13 5280 2736
160 9 6 5 6 7846 1787
161 3 5 4 3 2927 1552
162 4 8 5 4 3766 2128
163 9 1 11 5 7779 721
164 10 4 10 4 8455 1357
165 10 3 5 2 8521 1136
166 2 4 1 8 2207 1326
167 2 1 2 13 2150 723
168 1 14 1 5 1527 3505
169 10 6 13 0 8667 607
170 7 12 10 6 6194 2897
171 5 6 12 5 4485 1706
172 4 14 9 6 3764 3357
173 12 8 4 3 9852 2194
174 11 6 0 3 641 1762
175 4 5 12 4 3821 1613
176 12 0 3 10 10057 522
177 11 7 2 9 9288 1954
178 5 11 0 9 637 2745
179 7 3 12 11 6402 1132
180 14 5 1 0 11986 620
181 2 6 3 13 2141 2016
182 11 8 9 13 9388 2146
183 12 13 13 11 10279 3138
184 4 13 0 10 635 3120
185 7 11 6 10 6145 2789
186 7 0 11 13 6310 536
187 0 1 10 9 527 718
188 12 13 6 9 10391 3090
189 14 10 14 11 12297 2511
190 13 12 4 2 11124 2937
191 14 7 7 10 11840 1909
192 0 7 11 6 558 1929
193 10 5 8 7 8604 1573
194 4 1 13 14 3859 747
195 5 10 13 7 4486 2584
196 0 3 12 13 522 1137
197 7 0 13 14 6051 525
198 13 10 2 4 10971 2534
199 13 7 5 1 11374 1978
200 7 5 1 6133 1583
201 9 8 10 9 7755 2130
202 9 12 9 1 7747 2913
203 11 5 13 8 9282 1538
204 4 6 10 3737 6557
205 13 10 0 6 653 2528
206 5 2 6 1 4578 929
207 4 3 6 0 3921 610
208 4 2 7 13 3704 930
209 10 6 0 1 642 1751
210 1 9 12 8 1362 2468
211 3 6 0 2 661 1725
212 3 4 7 2 2986 1400
213 10 8 1 14 8607 2143
214 10 12 6 3 8538 2950
215 11 1 8 0 9260 633
216 5 9 3 10 4441 2374
217 14 3 13 3 11718 1132
218 5 10 10 14 4507 2509
219 6 0 8 4 5576 964
220 12 9 5 11 10427 2337
221 6 4 7 13 5226 1376
222 12 0 7 6 10218 596
223 5 1 1 4 4923 733
224 9 12 13 8258 2363
225 8 14 9 7006 3278
226 2 0 11 650 916
227 8 9 7 12 6943 2339
12 0 645
2 5 2192
7 14 6478
11 1 9436
10 9 8658
1 4 1355
2 13 2165
1 11 1388
3 12 2931
2 10 2162
7 0 638
1 2 1384
8 14 6945
1 13 1349
0 8 602
8 13 7151
6 12 5362
11 4 9381
12 14 10160
13 9 10754
5 9 4437
0 5 694
12 10 10466
1 10 1362
9 4 7532
13 8 11058
13 14 11414
2 12 2166
6 13 5332
0 0 1190
11 10 9264
2 14 2172
14 2 11901
+7 -9
View File
@@ -76,15 +76,13 @@ fn emit_node_scope(node: &RsxNode) -> TokenStream {
{ {
#deps_emit #deps_emit
r.dynamic_scope(move |scope| { r.dynamic_scope(move |scope| {
scope.access_children(|children| { if #cond {
if #cond { if scope.children.lock().unwrap().is_empty() {
if children.is_empty() { #(#kids)*
#(#kids)*
}
} else {
.children.clear();
} }
}) } else {
scope.children.lock().unwrap().clear();
}
}, #deps_vec_emit); }, #deps_vec_emit);
} }
} }
@@ -105,7 +103,7 @@ fn emit_node_scope(node: &RsxNode) -> TokenStream {
#deps_emit #deps_emit
#[allow(unused_parens)] #[allow(unused_parens)]
r.dynamic_scope(move |scope| { r.dynamic_scope(move |scope| {
scope.access_children(|children| children.clear()); scope.children.lock().unwrap().clear();
for #pat in #expr { for #pat in #expr {
#(#kids)* #(#kids)*
} }
+20 -77
View File
@@ -20,7 +20,7 @@ pub struct Context {
component: AccessCell<Component>, component: AccessCell<Component>,
view: AccessCell<View>, view: AccessCell<View>,
event_handlers: AccessCell<HashMap<TypeId, Vec<EventHandler>>>, event_handlers: AccessCell<HashMap<TypeId, Vec<EventHandler>>>,
scopes: AccessCell<Vec<Arc<Scope>>>, pub(crate) scopes: Mutex<Vec<Arc<Scope>>>,
executor: Arc<dyn CommandExecutor>, executor: Arc<dyn CommandExecutor>,
} }
@@ -33,7 +33,7 @@ impl Context {
component: AccessCell::new(Arc::new(component)), component: AccessCell::new(Arc::new(component)),
view: AccessCell::new(Arc::new(|_| {})), view: AccessCell::new(Arc::new(|_| {})),
event_handlers: AccessCell::new(HashMap::new()), event_handlers: AccessCell::new(HashMap::new()),
scopes: AccessCell::new(Vec::new()), scopes: Mutex::new(Vec::new()),
executor, executor,
}) })
} }
@@ -83,10 +83,6 @@ impl Context {
self.view.access_ref().clone() self.view.access_ref().clone()
} }
pub fn access_view(self: &Arc<Self>, f: impl FnOnce(&mut View) + Send + 'static) {
self.view.access(f)
}
pub fn on_event<T: Any + 'static, F: Fn(&Arc<Self>, &T) + Send + Sync + 'static>( pub fn on_event<T: Any + 'static, F: Fn(&Arc<Self>, &T) + Send + Sync + 'static>(
self: &Arc<Self>, self: &Arc<Self>,
handler: F, handler: F,
@@ -115,16 +111,11 @@ impl Context {
(h.lock().unwrap())(self, event.as_ref()); (h.lock().unwrap())(self, event.as_ref());
} }
self.scopes.access(move |scopes| { for scope in self.scopes.lock().unwrap().iter() {
for scope in scopes { for (child, _) in scope.children.lock().unwrap().iter() {
let event = event.clone(); child.emit_event(event.clone());
scope.access_children(move |children| {
for (child, _) in children {
child.emit_event(event.clone());
}
});
} }
}); }
} }
pub fn emit_event_threaded<E: Any + Send + Sync + Clone + 'static>( pub fn emit_event_threaded<E: Any + Send + Sync + Clone + 'static>(
@@ -143,26 +134,16 @@ impl Context {
}); });
} }
let event = event.clone(); for scope in self.scopes.lock().unwrap().iter() {
self.scopes.access(move |scopes| { for (child, _) in scope.children.lock().unwrap().iter() {
for scope in scopes { child.emit_event_threaded(event);
let event = event.clone();
scope.access_children(move |children| {
for (child, _) in children {
child.emit_event_threaded(&event);
}
});
} }
}); }
} }
pub fn scope(self: &Arc<Self>) -> Arc<Scope> { pub fn scope(self: &Arc<Self>) -> Arc<Scope> {
let scope = Scope::new(self.executor.clone()); let scope = Scope::new(self.executor.clone());
self.scopes.lock().unwrap().push(scope.clone());
self.scopes.access({
let scope = scope.clone();
move |scopes| scopes.push(scope)
});
scope scope
} }
@@ -173,11 +154,7 @@ impl Context {
dependencies: &[&dyn HookDependency], dependencies: &[&dyn HookDependency],
) -> Arc<Scope> { ) -> Arc<Scope> {
let scope = Scope::new(self.executor.clone()); let scope = Scope::new(self.executor.clone());
self.scopes.lock().unwrap().push(scope.clone());
self.scopes.access({
let scope = scope.clone();
move |scopes| scopes.push(scope)
});
drawer(&scope); drawer(&scope);
@@ -195,54 +172,20 @@ impl Context {
} }
pub fn add_scope(self: &Arc<Self>, scope: Arc<Scope>) { pub fn add_scope(self: &Arc<Self>, scope: Arc<Scope>) {
self.scopes.access(|scopes| scopes.push(scope)); self.scopes.lock().unwrap().push(scope);
} }
pub fn draw_children(self: &Arc<Self>, ctx: &mut DrawContext) { pub fn draw_children(self: &Arc<Self>, ctx: &mut DrawContext) {
let cmds: Arc< for scope in self.scopes.lock().unwrap().iter() {
Mutex< for (child, view_wrapper) in scope.children.lock().unwrap().iter() {
Vec<( let view = child.get_view();
Option<
Arc<
dyn Fn(
&mut DrawContext,
Arc<dyn Fn(&mut DrawContext) + Send + Sync + 'static>,
) + Send
+ Sync,
>,
>,
Arc<dyn Fn(&mut DrawContext) + Send + Sync>,
)>,
>,
> = Arc::new(Mutex::new(Vec::new()));
self.scopes.access({ if let Some(view_wrapper) = view_wrapper {
let cmds = cmds.clone(); view_wrapper(ctx, view)
move |scopes| { } else {
for scope in scopes { ctx.draw_view(ctx.area.clone(), view);
scope.access_children({
let cmds = cmds.clone();
move |children| {
for (child, view_wrapper) in children {
let view_wrapper = view_wrapper.clone();
let cmds = cmds.clone();
child.access_view(move |view| {
cmds.lock().unwrap().push((view_wrapper, view.clone()))
});
}
}
});
} }
} }
});
for (view_wrapper, view) in cmds.lock().unwrap().iter() {
if let Some(wrapper) = view_wrapper {
wrapper(ctx, view.clone());
} else {
let area = ctx.area.clone();
ctx.draw_view(area, view.clone());
}
} }
} }
+8 -23
View File
@@ -1,19 +1,18 @@
use super::{context::Context, ComponentImpl}; use std::sync::{Arc, Mutex};
use crate::{engine::CommandExecutor, View, ViewWrapper};
use access_cell::AccessCell;
use std::sync::Arc;
pub type ScopeChildren = Vec<(Arc<Context>, Option<ViewWrapper>)>; use crate::{engine::CommandExecutor, View, ViewWrapper};
use super::{context::Context, ComponentImpl};
pub struct Scope { pub struct Scope {
children: AccessCell<ScopeChildren>, pub children: Mutex<Vec<(Arc<Context>, Option<ViewWrapper>)>>,
executor: Arc<dyn CommandExecutor>, executor: Arc<dyn CommandExecutor>,
} }
impl Scope { impl Scope {
pub fn new(executor: Arc<dyn CommandExecutor>) -> Arc<Self> { pub fn new(executor: Arc<dyn CommandExecutor>) -> Arc<Self> {
Arc::new(Self { Arc::new(Self {
children: AccessCell::new(Vec::new()), children: Mutex::new(Vec::new()),
executor, executor,
}) })
} }
@@ -27,8 +26,7 @@ impl Scope {
ctx.refresh(); ctx.refresh();
self.children self.children.lock().unwrap().push((ctx, view_wrapper));
.access(|children| children.push((ctx, view_wrapper)));
} }
pub fn view(self: &Arc<Self>, view: View) { pub fn view(self: &Arc<Self>, view: View) {
@@ -36,19 +34,6 @@ impl Scope {
ctx.refresh(); ctx.refresh();
self.children.access(|children| children.push((ctx, None))); self.children.lock().unwrap().push((ctx, None));
}
pub fn view_wrapper(self: &Arc<Self>, view: View, view_wrapper: Option<ViewWrapper>) {
let ctx = Context::new(view, self.executor.clone());
ctx.refresh();
self.children
.access(|children| children.push((ctx, view_wrapper)));
}
pub fn access_children(self: &Arc<Self>, f: impl FnOnce(&mut ScopeChildren) + Send + 'static) {
self.children.access(f);
} }
} }