euv-core 0.49.4

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
use super::*;

/// Mounts a `view` container node with `Style::default()` in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_view_default() -> NodeId {
    mount_view(Style::default())
}

/// Mounts a `view` container node with `style` in one monomorphic call.
///
/// # Arguments
///
/// - `Style` - Initial box style.
///
/// # Returns
///
/// - `NodeId` - Created container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_view(style: Style) -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_view(style),
            NodeId::default(),
        )
    })
}

/// Mounts a horizontal `row` flex container with default style in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created row container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_row_default() -> NodeId {
    mount_view(Style::default())
}

/// Mounts a horizontal `row` flex container enforcing `FlexDirection::Row` in one monomorphic call.
///
/// # Arguments
///
/// - `Style` - Base container style.
///
/// # Returns
///
/// - `NodeId` - Created row container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_row(mut style: Style) -> NodeId {
    let layout: &mut LayoutStyle = style.get_mut_layout();
    if layout.get_display() != Display::None {
        layout.set_display(Display::Flex);
    }
    layout.set_flex_direction(FlexDirection::Row);
    mount_view(style)
}

/// Mounts a vertical `column` flex container with default style in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created column container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_column_default() -> NodeId {
    let mut style: Style = Style::default();
    style
        .get_mut_layout()
        .set_flex_direction(FlexDirection::Column);
    mount_view(style)
}

/// Mounts a vertical `column` flex container enforcing `FlexDirection::Column` in one monomorphic call.
///
/// # Arguments
///
/// - `Style` - Base container style.
///
/// # Returns
///
/// - `NodeId` - Created column container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_column(mut style: Style) -> NodeId {
    let layout: &mut LayoutStyle = style.get_mut_layout();
    if layout.get_display() != Display::None {
        layout.set_display(Display::Flex);
    }
    layout.set_flex_direction(FlexDirection::Column);
    mount_view(style)
}

/// Mounts a 2-column `grid` container with default style in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created grid container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_grid_default() -> NodeId {
    let mut style: Style = Style::default();
    style
        .get_mut_layout()
        .set_display(Display::Grid)
        .set_grid_columns(2);
    mount_view(style)
}

/// Mounts a `grid` container defaulting to 2 columns when `Display::Grid` was not explicitly set.
///
/// # Arguments
///
/// - `Style` - Base grid container style.
///
/// # Returns
///
/// - `NodeId` - Created grid container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_grid(mut style: Style) -> NodeId {
    let layout: &mut LayoutStyle = style.get_mut_layout();
    if layout.get_display() != Display::Grid && layout.get_display() != Display::None {
        layout.set_display(Display::Grid).set_grid_columns(2);
    }
    mount_view(style)
}

/// Mounts a vertical `scroll` container with default style in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created scroll container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_scroll_default() -> NodeId {
    let mut style: Style = Style::default();
    style
        .get_mut_layout()
        .set_flex_direction(FlexDirection::Column);
    mount_scroll(style)
}

/// Mounts a `scroll` container with `style` in one monomorphic call.
///
/// # Arguments
///
/// - `Style` - Scroll container style.
///
/// # Returns
///
/// - `NodeId` - Created scroll container node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_scroll(style: Style) -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_scroll_view(style),
            NodeId::default(),
        )
    })
}

/// Mounts a `portal` overlay node with default style in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created portal node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_portal_default() -> NodeId {
    mount_portal(Style::default())
}

/// Mounts a `portal` overlay node with `style` in one monomorphic call.
///
/// # Arguments
///
/// - `Style` - Portal style.
///
/// # Returns
///
/// - `NodeId` - Created portal node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_portal(style: Style) -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_portal(style),
            NodeId::default(),
        )
    })
}

/// Mounts a logical `fragment` grouping node in one monomorphic call.
///
/// # Returns
///
/// - `NodeId` - Created fragment node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_fragment() -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_fragment(),
            NodeId::default(),
        )
    })
}

/// Mounts a static `text` node with `Style::default()` from a `&str` slice in one monomorphic call.
///
/// # Arguments
///
/// - `&str` - Static UTF-8 text content.
///
/// # Returns
///
/// - `NodeId` - Created text node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_plain_text_str(content: &str) -> NodeId {
    mount_text_str(content, Style::default())
}

/// Mounts a static `text` node with `style` from a `&str` slice in one monomorphic call.
///
/// # Arguments
///
/// - `&str` - Static UTF-8 text content.
/// - `Style` - Text style.
///
/// # Returns
///
/// - `NodeId` - Created text node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_text_str(content: &str, style: Style) -> NodeId {
    let owned_text: String = content.to_string();
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_text(owned_text, style),
            NodeId::default(),
        )
    })
}

/// Mounts an `input` leaf node from `state` and `style` in one monomorphic call.
///
/// # Arguments
///
/// - `InputNodeState` - Initial input node state.
/// - `Style` - Input style.
///
/// # Returns
///
/// - `NodeId` - Created input node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_input_node(state: InputNodeState, style: Style) -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_input(state, style),
            NodeId::default(),
        )
    })
}

/// Mounts an `image` leaf node from `buffer` and `style` in one monomorphic call.
///
/// # Arguments
///
/// - `ImageBuffer` - Decoded RGBA8 image buffer.
/// - `Style` - Image style.
///
/// # Returns
///
/// - `NodeId` - Created image node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_image_node(buffer: ImageBuffer, style: Style) -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_image(buffer, style),
            NodeId::default(),
        )
    })
}

/// Mounts a `canvas` leaf node with `style`, `caching`, and `painter` in one monomorphic call.
///
/// # Arguments
///
/// - `Style` - Canvas style.
/// - `CanvasCaching` - Fragment caching strategy.
/// - `CanvasDrawCallback` - Shared canvas draw callback.
///
/// # Returns
///
/// - `NodeId` - Created canvas node handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn mount_canvas_node(
    style: Style,
    caching: CanvasCaching,
    painter: CanvasDrawCallback,
) -> NodeId {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| tree.create_canvas_with_caching(style, caching, painter),
            NodeId::default(),
        )
    })
}

/// Mounts a `slot` dynamic component slot in one monomorphic call.
///
/// # Arguments
///
/// - `String` - Slot identifier.
/// - `Style` - Slot wrapper style.
/// - `Option<DynamicUpdateHub>` - Optional explicit dynamic hub override.
/// - `DynamicSlotFallback` - Fallback builder closure.
///
/// # Returns
///
/// - `NodeId` - Mounted dynamic component slot node handle.
#[must_use]
pub fn mount_dynamic_slot(
    slot_id: String,
    style: Style,
    hub: Option<DynamicUpdateHub>,
    fallback: DynamicSlotFallback,
) -> NodeId {
    let mut slot: DynamicComponentSlot = DynamicComponentSlot::new(slot_id, fallback);
    let _: &mut DynamicComponentSlot = slot.set_style(style);
    if hub.is_some() {
        let _: &mut DynamicComponentSlot = slot.set_hub(hub);
    }
    Component::mount(slot)
}

/// Mounts a `page_slot` dynamic page slot in one monomorphic call.
///
/// # Arguments
///
/// - `String` - Page route key.
/// - `Style` - Slot wrapper style.
/// - `Option<DynamicUpdateHub>` - Optional explicit dynamic hub override.
/// - `DynamicSlotFallback` - Fallback builder closure.
///
/// # Returns
///
/// - `NodeId` - Mounted dynamic page slot node handle.
#[must_use]
pub fn mount_dynamic_page_slot(
    route: String,
    style: Style,
    hub: Option<DynamicUpdateHub>,
    fallback: DynamicSlotFallback,
) -> NodeId {
    let mut slot: DynamicPageSlot = DynamicPageSlot::new(route, fallback);
    let _: &mut DynamicPageSlot = slot.set_style(style);
    if hub.is_some() {
        let _: &mut DynamicPageSlot = slot.set_hub(hub);
    }
    Component::mount(slot)
}

/// Builds an empty fallback `DynamicSlotFallback` for `slot` and `page_slot` without duplicating closure AST per macro call site.
///
/// # Returns
///
/// - `DynamicSlotFallback` - Shared empty view fallback builder.
#[must_use]
pub fn empty_slot_fallback() -> DynamicSlotFallback {
    Rc::new(mount_view_default)
}

/// Mounts a full-width column wrapper used for multi-child `slot` and `page_slot` fallbacks.
///
/// # Returns
///
/// - `NodeId` - Mounted full-width column wrapper node.
#[must_use]
pub fn mount_slot_fallback_column() -> NodeId {
    let mut style: Style = Style::default();
    style
        .get_mut_layout()
        .set_flex_direction(FlexDirection::Column)
        .set_width(Length::Percent(100.0));
    mount_view(style)
}

/// Appends a single child `NodeId` to `parent` in one monomorphic call.
///
/// # Arguments
///
/// - `NodeId` - Parent container node handle.
/// - `NodeId` - Child node handle to attach.
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn append_view_child(parent: NodeId, child: NodeId) {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| {
                tree.append_child(parent, child);
            },
            (),
        );
    });
}

/// Appends a slice of `children` to `parent` in one monomorphic call.
///
/// # Arguments
///
/// - `NodeId` - Parent container node handle.
/// - `&[NodeId]` - Ordered child node handles to attach.
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn append_view_children(parent: NodeId, children: &[NodeId]) {
    if children.is_empty() {
        return;
    }
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| {
                tree.append_children(parent, children);
            },
            (),
        );
    });
}

/// Mounts every item in `items` and appends the resulting slice to `parent`.
///
/// # Arguments
///
/// - `NodeId` - Parent container node handle.
/// - `Iter` - Iterable of mountable `Component` items.
pub fn mount_spread_into<Iter, Item>(parent: NodeId, items: Iter)
where
    Iter: IntoIterator<Item = Item>,
    Item: Component,
{
    let mounted: Vec<NodeId> = items.into_iter().map(Component::mount).collect();
    append_view_children(parent, &mounted);
}

/// Mounts every item in `items` and appends the resulting `NodeId`s into `batch`.
///
/// # Arguments
///
/// - `&mut Vec<NodeId>` - Target child accumulator.
/// - `Iter` - Iterable of mountable `Component` items.
pub fn extend_spread_into<Iter, Item>(batch: &mut Vec<NodeId>, items: Iter)
where
    Iter: IntoIterator<Item = Item>,
    Item: Component,
{
    batch.extend(items.into_iter().map(Component::mount));
}

/// Wraps an event closure into a `UiEventHandler` without emitting local helper functions at every `view!` call site.
///
/// # Arguments
///
/// - `HandlerFn` - Event callback closure receiving `&UiEvent`.
///
/// # Returns
///
/// - `UiEventHandler` - Shared boxed event callback.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn into_ui_event_handler<HandlerFn>(handler: HandlerFn) -> UiEventHandler
where
    HandlerFn: FnMut(&UiEvent) + 'static,
{
    Rc::new(RefCell::new(handler))
}

/// Wraps a canvas painter closure into a `CanvasDrawCallback` without emitting local helper functions at every `view!` call site.
///
/// # Arguments
///
/// - `PainterFn` - Canvas draw closure receiving `(Rect, &mut DisplayList)`.
///
/// # Returns
///
/// - `CanvasDrawCallback` - Shared boxed canvas painter callback.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn into_canvas_painter<PainterFn>(painter: PainterFn) -> CanvasDrawCallback
where
    PainterFn: FnMut(Rect, &mut DisplayList) + 'static,
{
    Rc::new(RefCell::new(painter))
}

/// Fast-path monomorphic helper attaching a single `on_click` handler, focusable flag, and pointer cursor onto `node`.
///
/// # Arguments
///
/// - `NodeId` - Target scene node handle.
/// - `UiEventHandler` - Click callback handler.
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn bind_node_on_click(node: NodeId, handler: UiEventHandler) {
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| {
                if let Some(scene_node) = tree.get_node_mut(node) {
                    scene_node.get_mut_handlers().set_on_click(Some(handler));
                    scene_node.get_mut_interaction().set_focusable(true);
                    let paint: &mut PaintStyle = scene_node.get_mut_style().get_mut_paint();
                    if paint.get_cursor() == CursorIcon::Default {
                        paint.set_cursor(CursorIcon::Pointer);
                    }
                }
            },
            (),
        );
    });
}

/// Appends a single child `NodeId` to `parent` and returns `parent` for zero-local expression chaining.
///
/// # Arguments
///
/// - `NodeId` - Parent container node handle.
/// - `NodeId` - Child node handle to attach.
///
/// # Returns
///
/// - `NodeId` - Unmodified `parent` handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn finish_node_child(parent: NodeId, child: NodeId) -> NodeId {
    append_view_child(parent, child);
    parent
}

/// Appends a slice of `children` to `parent` and returns `parent` for zero-local expression chaining.
///
/// # Arguments
///
/// - `NodeId` - Parent container node handle.
/// - `&[NodeId]` - Ordered child node handles to attach.
///
/// # Returns
///
/// - `NodeId` - Unmodified `parent` handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn finish_node_children(parent: NodeId, children: &[NodeId]) -> NodeId {
    append_view_children(parent, children);
    parent
}

/// Attaches a single `on_click` handler onto `node` and returns `node` for zero-local expression chaining.
///
/// # Arguments
///
/// - `NodeId` - Target scene node handle.
/// - `UiEventHandler` - Click callback handler.
///
/// # Returns
///
/// - `NodeId` - Unmodified `node` handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn finish_node_on_click(node: NodeId, handler: UiEventHandler) -> NodeId {
    bind_node_on_click(node, handler);
    node
}

/// Applies `patch` onto `node` under one scene write lock and returns `node` for zero-local expression chaining.
///
/// # Arguments
///
/// - `NodeId` - Target scene node handle.
/// - `NodeInitPatch` - Accumulated event and accessibility modifiers.
///
/// # Returns
///
/// - `NodeId` - Unmodified `node` handle.
#[must_use]
#[cfg_attr(not(target_arch = "wasm32"), inline)]
pub fn finish_node_patch(node: NodeId, patch: NodeInitPatch) -> NodeId {
    apply_node_init_patch(node, patch);
    node
}

/// Applies all event handlers, focusability, and accessibility metadata in `patch` onto `node` under a single scene write lock.
///
/// # Arguments
///
/// - `NodeId` - Target scene node handle.
/// - `NodeInitPatch` - Accumulated event and accessibility modifiers.
pub fn apply_node_init_patch(node: NodeId, patch: NodeInitPatch) {
    let NodeInitPatch {
        focusable,
        on_click,
        on_change,
        on_scroll,
        on_pointer_down,
        on_pointer_move,
        on_pointer_up,
        on_pointer_enter,
        on_pointer_leave,
        on_key_down,
        on_focus,
        on_blur,
        a11y,
    } = patch;
    with_current_context(|context: &Context| {
        context.get_scene().with_write(
            |tree: &mut SceneTree| {
                let Some(scene_node) = tree.get_node_mut(node) else {
                    return;
                };
                if let Some(is_focusable) = focusable {
                    scene_node.get_mut_interaction().set_focusable(is_focusable);
                }
                if let Some(handler) = on_click {
                    scene_node.get_mut_handlers().set_on_click(Some(handler));
                    scene_node.get_mut_interaction().set_focusable(true);
                    let paint: &mut PaintStyle = scene_node.get_mut_style().get_mut_paint();
                    if paint.get_cursor() == CursorIcon::Default {
                        paint.set_cursor(CursorIcon::Pointer);
                    }
                }
                if let Some(handler) = on_change {
                    scene_node.get_mut_handlers().set_on_change(Some(handler));
                }
                if let Some(handler) = on_scroll {
                    scene_node.get_mut_handlers().set_on_scroll(Some(handler));
                }
                if let Some(handler) = on_pointer_down {
                    scene_node
                        .get_mut_handlers()
                        .set_on_pointer_down(Some(handler));
                    let paint: &mut PaintStyle = scene_node.get_mut_style().get_mut_paint();
                    if paint.get_cursor() == CursorIcon::Default {
                        paint.set_cursor(CursorIcon::Pointer);
                    }
                }
                if let Some(handler) = on_pointer_move {
                    scene_node
                        .get_mut_handlers()
                        .set_on_pointer_move(Some(handler));
                }
                if let Some(handler) = on_pointer_up {
                    scene_node
                        .get_mut_handlers()
                        .set_on_pointer_up(Some(handler));
                }
                if let Some(handler) = on_pointer_enter {
                    scene_node
                        .get_mut_handlers()
                        .set_on_pointer_enter(Some(handler));
                }
                if let Some(handler) = on_pointer_leave {
                    scene_node
                        .get_mut_handlers()
                        .set_on_pointer_leave(Some(handler));
                }
                if let Some(handler) = on_key_down {
                    scene_node.get_mut_handlers().set_on_key_down(Some(handler));
                    scene_node.get_mut_interaction().set_focusable(true);
                }
                if let Some(handler) = on_focus {
                    scene_node.get_mut_handlers().set_on_focus(Some(handler));
                    scene_node.get_mut_interaction().set_focusable(true);
                }
                if let Some(handler) = on_blur {
                    scene_node.get_mut_handlers().set_on_blur(Some(handler));
                }
                if let Some(props) = a11y {
                    scene_node.set_a11y(Some(props));
                }
            },
            (),
        );
    });
}