pub struct ElementContext<'a, H: UiHost> {
pub app: &'a mut H,
pub window: AppWindowId,
pub frame_id: FrameId,
pub bounds: Rect,
/* private fields */
}Expand description
Per-frame view construction context passed to declarative element constructors.
ElementContext exposes:
- a mutable handle to the app/host (
cx.app) implementingUiHost, - the current window id and frame id,
- helper constructors for common element kinds (containers, text, input, overlays, etc.),
- access to theme and environment queries.
It is created and owned by [UiTree] and should be treated as an ephemeral, frame-scoped API.
Fields§
§app: &'a mut H§window: AppWindowId§frame_id: FrameId§bounds: RectImplementations§
Source§impl<'a, H: UiHost> ElementContext<'a, H>
impl<'a, H: UiHost> ElementContext<'a, H>
pub fn new( app: &'a mut H, runtime: &'a mut ElementRuntime, window: AppWindowId, bounds: Rect, root: GlobalElementId, ) -> Self
pub fn new_for_root_name( app: &'a mut H, runtime: &'a mut ElementRuntime, window: AppWindowId, bounds: Rect, root_name: &str, ) -> Self
pub fn root_id(&self) -> GlobalElementId
Sourcepub fn inherited_state<S: Any>(&self) -> Option<&S>
pub fn inherited_state<S: Any>(&self) -> Option<&S>
Returns the nearest ancestor state value of type S in the current element scope stack.
This is a lightweight building block for component-layer “provider” patterns (e.g. Radix
DirectionProvider) without requiring a dedicated runtime context mechanism.
Sourcepub fn inherited_state_where<S: Any>(
&self,
predicate: impl Fn(&S) -> bool,
) -> Option<&S>
pub fn inherited_state_where<S: Any>( &self, predicate: impl Fn(&S) -> bool, ) -> Option<&S>
Like inherited_state, but allows skipping “inactive” states while continuing to search.
This is useful when a state entry remains allocated but temporarily holds no active value
(e.g. an Option<T> that is None outside of a scope).
Sourcepub fn provided<S: Any>(&self) -> Option<&S>
pub fn provided<S: Any>(&self) -> Option<&S>
Returns the nearest value installed via Self::provide for type S.
Sourcepub fn provided_where<S: Any>(
&self,
predicate: impl Fn(&S) -> bool,
) -> Option<&S>
pub fn provided_where<S: Any>( &self, predicate: impl Fn(&S) -> bool, ) -> Option<&S>
Like Self::provided, but allows filtering values while continuing the ancestor search.
Sourcepub fn node_for_element(&self, element: GlobalElementId) -> Option<NodeId>
pub fn node_for_element(&self, element: GlobalElementId) -> Option<NodeId>
Returns the last known NodeId for a declarative element, if available.
This is intentionally a last-known query surface: authoritative render-time correctness paths should prefer live window-frame or attached-tree resolution instead of treating this as the current attached node.
It remains safe to call during element rendering because it reads from the ElementCx’s
already borrowed window state, avoiding re-entrant UiHost::with_global_mut leases.
Sourcepub fn live_node_for_element(
&mut self,
element: GlobalElementId,
) -> Option<NodeId>
pub fn live_node_for_element( &mut self, element: GlobalElementId, ) -> Option<NodeId>
Returns the current-frame node mapping for element, if available.
The authoritative liveness signal is the retained node_entry record being touched in the
current frame (last_seen_frame == self.frame_id).
pub fn focused_element(&self) -> Option<GlobalElementId>
pub fn is_focused_element(&self, element: GlobalElementId) -> bool
Sourcepub fn is_focus_within_element(&mut self, element: GlobalElementId) -> bool
pub fn is_focus_within_element(&mut self, element: GlobalElementId) -> bool
Returns true when the currently focused element is element itself or any descendant in
the declarative element tree for this window.
pub fn has_active_text_selection(&self) -> bool
pub fn has_active_text_selection_in_root(&self, root: GlobalElementId) -> bool
Sourcepub fn last_bounds_for_element(&self, element: GlobalElementId) -> Option<Rect>
pub fn last_bounds_for_element(&self, element: GlobalElementId) -> Option<Rect>
Returns the last frame’s bounds for a declarative element, if available.
This is safe to call during element rendering: it reads from the ElementCx’s already
borrowed window state, avoiding re-entrant UiHost::with_global_mut leases.
Sourcepub fn last_visual_bounds_for_element(
&self,
element: GlobalElementId,
) -> Option<Rect>
pub fn last_visual_bounds_for_element( &self, element: GlobalElementId, ) -> Option<Rect>
Returns the last frame’s visual bounds (post-render_transform AABB) for a declarative
element, if available.
This is intended for anchored overlay policies that must track render transforms (ADR 0083) without mixing layout transforms into the layout solver.
Sourcepub fn root_bounds_for_element(&self, element: GlobalElementId) -> Option<Rect>
pub fn root_bounds_for_element(&self, element: GlobalElementId) -> Option<Rect>
Returns the last recorded root bounds for the element’s root, if available.
This is safe to call during element rendering for the same reason as
last_bounds_for_element.
Sourcepub fn take_transient(&mut self, key: u64) -> bool
pub fn take_transient(&mut self, key: u64) -> bool
Consume a transient event flag for the current element.
This returns true at most once per recorded event (clear-on-read).
Sourcepub fn take_transient_for(&mut self, element: GlobalElementId, key: u64) -> bool
pub fn take_transient_for(&mut self, element: GlobalElementId, key: u64) -> bool
Consume a transient event flag for the specified element.
This returns true at most once per recorded event (clear-on-read).
pub fn with_root_name<R>( &mut self, root_name: &str, f: impl FnOnce(&mut Self) -> R, ) -> R
Sourcepub fn with_callsite_counters_snapshot<R>(
&mut self,
f: impl FnOnce(&mut Self) -> R,
) -> R
pub fn with_callsite_counters_snapshot<R>( &mut self, f: impl FnOnce(&mut Self) -> R, ) -> R
Runs f and then restores the current callsite counters to their previous state.
This is useful when you need to “probe-render” a subtree (e.g. to compute derived
information like focus_within) without consuming callsite slots and disturbing
subsequent element identity in the real render pass.
Sourcepub fn request_frame(&mut self)
pub fn request_frame(&mut self)
Request a window redraw (one-shot).
Use this after mutating state/models to schedule a repaint.
Notes:
- This does not guarantee frame-driven progression. If you need to advance without input
events (animations, progressive rendering), prefer
request_animation_frame()orbegin_continuous_frames(). - This is not a timer: callers that need continuous progression must keep requesting frames.
Sourcepub fn notify_for_animation_frame(&mut self)
pub fn notify_for_animation_frame(&mut self)
Mark the nearest cache root as needing a paint notification on the next mount.
This is a lightweight way to force paint-cache roots to rerun paint (e.g. while animating opacity/transform) without necessarily requesting a new animation frame from the runner.
Sourcepub fn request_animation_frame(&mut self)
pub fn request_animation_frame(&mut self)
Request the next animation frame for this window.
Use this for frame-driven updates that must advance without input events.
This is a one-shot request. Prefer begin_continuous_frames() when driving animations from
declarative UI code.
Sourcepub fn begin_continuous_frames(&mut self) -> ContinuousFrames
pub fn begin_continuous_frames(&mut self) -> ContinuousFrames
Begin a “continuous frames” lease for this window.
This is the preferred way for declarative UI to drive animations: while the returned lease is held, the mount pass will continue requesting animation frames.
Sourcepub fn set_timer_for(
&mut self,
element: GlobalElementId,
token: TimerToken,
after: Duration,
)
pub fn set_timer_for( &mut self, element: GlobalElementId, token: TimerToken, after: Duration, )
Request a one-shot timer event routed to the given element.
This records the timer target in the current window element runtime, enabling
Event::Timer { token } to be dispatched to the element’s on_timer hook.
Sourcepub fn set_timer(&mut self, token: TimerToken, after: Duration)
pub fn set_timer(&mut self, token: TimerToken, after: Duration)
Request a one-shot timer event routed to the current element.
Sourcepub fn cancel_timer(&mut self, token: TimerToken)
pub fn cancel_timer(&mut self, token: TimerToken)
Cancel a previously requested timer and clear its routing entry for this window.
pub fn scope<R>(&mut self, f: impl FnOnce(&mut Self) -> R) -> R
pub fn keyed<K: Hash, R>(&mut self, key: K, f: impl FnOnce(&mut Self) -> R) -> R
pub fn named<R>(&mut self, name: &str, f: impl FnOnce(&mut Self) -> R) -> R
Sourcepub fn root_state<S: Any, R>(
&mut self,
init: impl FnOnce() -> S,
f: impl FnOnce(&mut S) -> R,
) -> R
pub fn root_state<S: Any, R>( &mut self, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R
Component/internal identity lane: accesses root-scoped state stored under the current
root_id().
This is keyed by (root_id, TypeId), so it is a shared slot per element root.
Repeated calls with the same state type under the same root intentionally see the same
state. If you need multiple independent slots of the same type, create a child scope first
via Self::scope, Self::keyed, or another helper that allocates a distinct root id.
Sourcepub fn with_state<S: Any, R>(
&mut self,
init: impl FnOnce() -> S,
f: impl FnOnce(&mut S) -> R,
) -> R
👎Deprecated: use root_state(…) for root-scoped shared element state
pub fn with_state<S: Any, R>( &mut self, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R
use root_state(…) for root-scoped shared element state
Compatibility alias for Self::root_state.
Prefer Self::root_state in new first-party code. Keep this alias for migration and
downstream compatibility only.
Sourcepub fn slot_state<S: Any, R>(
&mut self,
init: impl FnOnce() -> S,
f: impl FnOnce(&mut S) -> R,
) -> R
pub fn slot_state<S: Any, R>( &mut self, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R
Component/internal identity lane: accesses helper-local state stored under a synthetic callsite-derived slot.
Unlike Self::root_state, this does not use the current root_id() directly. The slot is
derived from (current_root, caller_location, call_index_at_that_location) so distinct
callsites of the same state type do not collide.
This is the correct primitive for helper-owned internals that want React hook-like slot
semantics without allocating a visible child scope in the element stack. The derived slot is
intentionally not pushed onto the inherited-state stack, so descendants cannot observe
it via Self::inherited_state.
If a helper needs to touch the same slot more than once during one render pass, either do
all work inside a single closure or allocate the slot once via Self::slot_id and then
use Self::state_for for repeated accesses.
When the helper may be invoked from a reorderable collection, prefer wrapping the caller in
Self::keyed (or use Self::keyed_slot_state) so the surrounding identity stays stable
across insertions and reordering.
Sourcepub fn keyed_slot_state<K: Hash, S: Any, R>(
&mut self,
key: K,
init: impl FnOnce() -> S,
f: impl FnOnce(&mut S) -> R,
) -> R
pub fn keyed_slot_state<K: Hash, S: Any, R>( &mut self, key: K, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R
Like Self::slot_state, but derives the synthetic slot from (callsite, key).
This mirrors Self::keyed: repeated renders with the same key reuse the same state slot
even if sibling order changes.
Sourcepub fn slot_id(&mut self) -> GlobalElementId
pub fn slot_id(&mut self) -> GlobalElementId
Allocates a synthetic callsite-derived state slot id without pushing a child scope.
Use this when one helper invocation needs to read/write the same helper-local slot multiple times during a single render pass.
Sourcepub fn keyed_slot_id<K: Hash>(&mut self, key: K) -> GlobalElementId
pub fn keyed_slot_id<K: Hash>(&mut self, key: K) -> GlobalElementId
Like Self::slot_id, but keys the synthetic slot by (callsite, key).
This is useful for helper-local state inside reorderable collections where sibling order is not stable across renders.
Sourcepub fn local_model<T: Any>(&mut self, init: impl FnOnce() -> T) -> Model<T>
pub fn local_model<T: Any>(&mut self, init: impl FnOnce() -> T) -> Model<T>
Component/internal identity lane: returns a helper-local model handle stored under a synthetic callsite-derived slot.
This is the model-handle counterpart to Self::slot_state: the slot identity is local to
this helper invocation and stable across frames, so callers can create copy-paste-friendly
local Model<T> state without abusing root-scoped Self::with_state.
Sourcepub fn local_model_keyed<K: Hash, T: Any>(
&mut self,
key: K,
init: impl FnOnce() -> T,
) -> Model<T>
pub fn local_model_keyed<K: Hash, T: Any>( &mut self, key: K, init: impl FnOnce() -> T, ) -> Model<T>
Like Self::local_model, but keys the synthetic slot by (callsite, key).
Prefer this when one helper is invoked from a reorderable collection or when several local models are authored through a shared helper and need explicit, stable names.
Sourcepub fn state_for<S: Any, R>(
&mut self,
element: GlobalElementId,
init: impl FnOnce() -> S,
f: impl FnOnce(&mut S) -> R,
) -> R
pub fn state_for<S: Any, R>( &mut self, element: GlobalElementId, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R
Accesses state stored under an explicit element identity.
Sourcepub fn with_state_for<S: Any, R>(
&mut self,
element: GlobalElementId,
init: impl FnOnce() -> S,
f: impl FnOnce(&mut S) -> R,
) -> R
👎Deprecated: use state_for(…) for explicit-identity element state
pub fn with_state_for<S: Any, R>( &mut self, element: GlobalElementId, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R
use state_for(…) for explicit-identity element state
Compatibility alias for Self::state_for.
Prefer Self::state_for in new first-party code. Keep this alias for migration and
downstream compatibility only.
Sourcepub fn model_for<T: Any>(
&mut self,
element: GlobalElementId,
init: impl FnOnce() -> T,
) -> Model<T>
pub fn model_for<T: Any>( &mut self, element: GlobalElementId, init: impl FnOnce() -> T, ) -> Model<T>
Component/internal identity lane: returns a model handle stored under an explicit element identity.
This is the explicit-identity counterpart to Self::local_model and
Self::local_model_keyed. Prefer it when a helper must bind a Model<T> to a stable
overlay/portal/root id instead of a callsite-derived slot.
Like Self::state_for, storage is keyed by (element, TypeId). Different model value
types may therefore share one explicit element id, while multiple models of the same type
still need distinct explicit ids.
Sourcepub fn provide<S: Any, R>(
&mut self,
value: S,
f: impl FnOnce(&mut Self) -> R,
) -> R
pub fn provide<S: Any, R>( &mut self, value: S, f: impl FnOnce(&mut Self) -> R, ) -> R
Installs value as an inherited provider value for the current subtree.
This is the preferred authoring surface for provider-style patterns. It keeps provider semantics separate from raw root state while still using the same element-state substrate.
pub fn observe_model<T>(&mut self, model: &Model<T>, invalidation: Invalidation)
pub fn read_model<T: Any, R>( &mut self, model: &Model<T>, invalidation: Invalidation, f: impl FnOnce(&mut H, &T) -> R, ) -> Result<R, ModelUpdateError>
pub fn read_model_ref<T: Any, R>( &mut self, model: &Model<T>, invalidation: Invalidation, f: impl FnOnce(&T) -> R, ) -> Result<R, ModelUpdateError>
pub fn get_model_copied<T: Any + Copy>( &mut self, model: &Model<T>, invalidation: Invalidation, ) -> Option<T>
pub fn get_model_cloned<T: Any + Clone>( &mut self, model: &Model<T>, invalidation: Invalidation, ) -> Option<T>
pub fn observe_model_id(&mut self, model: ModelId, invalidation: Invalidation)
pub fn observe_global<T: Any>(&mut self, invalidation: Invalidation)
pub fn observe_global_id(&mut self, global: TypeId, invalidation: Invalidation)
pub fn observe_layout_query_region( &mut self, region: GlobalElementId, invalidation: Invalidation, )
pub fn layout_query_bounds( &mut self, region: GlobalElementId, invalidation: Invalidation, ) -> Option<Rect>
pub fn environment_viewport_bounds( &mut self, invalidation: Invalidation, ) -> Rect
pub fn environment_viewport_width(&mut self, invalidation: Invalidation) -> Px
pub fn environment_viewport_height(&mut self, invalidation: Invalidation) -> Px
pub fn environment_scale_factor(&mut self, invalidation: Invalidation) -> f32
pub fn environment_color_scheme( &mut self, invalidation: Invalidation, ) -> Option<ColorScheme>
pub fn environment_prefers_reduced_motion( &mut self, invalidation: Invalidation, ) -> Option<bool>
pub fn environment_text_scale_factor( &mut self, invalidation: Invalidation, ) -> Option<f32>
pub fn environment_prefers_reduced_transparency( &mut self, invalidation: Invalidation, ) -> Option<bool>
pub fn environment_accent_color( &mut self, invalidation: Invalidation, ) -> Option<Color>
pub fn environment_prefers_contrast( &mut self, invalidation: Invalidation, ) -> Option<ContrastPreference>
pub fn environment_forced_colors_mode( &mut self, invalidation: Invalidation, ) -> Option<ForcedColorsMode>
pub fn environment_safe_area_insets( &mut self, invalidation: Invalidation, ) -> Option<Edges>
pub fn environment_occlusion_insets( &mut self, invalidation: Invalidation, ) -> Option<Edges>
pub fn environment_primary_pointer_type( &mut self, invalidation: Invalidation, ) -> PointerType
pub fn environment_primary_pointer_can_hover( &mut self, invalidation: Invalidation, default_when_unknown: bool, ) -> bool
pub fn environment_primary_pointer_is_coarse( &mut self, invalidation: Invalidation, default_when_unknown: bool, ) -> bool
pub fn diagnostics_record_overlay_placement_anchored_panel( &mut self, overlay_root_name: Option<&str>, anchor_element: Option<GlobalElementId>, content_element: Option<GlobalElementId>, trace: AnchoredPanelLayoutTrace, )
pub fn diagnostics_record_overlay_placement_placed_rect( &mut self, overlay_root_name: Option<&str>, anchor_element: Option<GlobalElementId>, content_element: Option<GlobalElementId>, outer: Rect, anchor: Rect, placed: Rect, side: Option<Side>, )
pub fn theme(&mut self) -> &Theme
pub fn for_each_keyed<T, K: Hash>( &mut self, items: &[T], key: impl FnMut(&T) -> K, f: impl FnMut(&mut Self, usize, &T), )
pub fn for_each_unkeyed<T: Hash>( &mut self, items: &[T], f: impl FnMut(&mut Self, usize, &T), )
pub fn container<I>(
&mut self,
props: ContainerProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Sourcepub fn semantics<I>(
&mut self,
props: SemanticsProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn semantics<I>(
&mut self,
props: SemanticsProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Creates a Semantics layout wrapper around the subtree.
Semantics is intentionally input- and paint-transparent, but it does participate in
layout via SemanticsProps.layout. Use it when you need a semantics node boundary (tree
structure) or wrapper-only semantics features (e.g. a focusable semantics node).
If you only need to stamp test_id / label / role / value for diagnostics or UI
automation, prefer attaching SemanticsDecoration to an existing element via
AnyElement::attach_semantics(...) to avoid introducing a layout node.
pub fn semantic_flex<I>(
&mut self,
props: SemanticFlexProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn focus_scope<I>(
&mut self,
props: FocusScopeProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn view_cache<I>(
&mut self,
props: ViewCacheProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Sourcepub fn view_cache_keep_alive<I>(
&mut self,
props: ViewCacheProps,
keep_alive: bool,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn view_cache_keep_alive<I>(
&mut self,
props: ViewCacheProps,
keep_alive: bool,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Explicit keep-alive cache root for cases where the element producer may be skipped by view caching.
This mirrors the “reuse” side of view_cache(...), but makes the decision explicit:
- When
keep_alive=true, the subtree is kept alive even iffis not executed. - When
keep_alive=false,fis always executed (no implicit reuse).
This is a mechanism-layer escape hatch intended for overlay synthesis and similar systems that must preserve subtree liveness when the normal authoring closure does not run.
pub fn focus_scope_with_id<I>(
&mut self,
props: FocusScopeProps,
f: impl FnOnce(&mut Self, GlobalElementId) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn layout_query_region_with_id<I>(
&mut self,
props: LayoutQueryRegionProps,
f: impl FnOnce(&mut Self, GlobalElementId) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn layout_query_region<I>(
&mut self,
props: LayoutQueryRegionProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Sourcepub fn semantics_with_id<I>(
&mut self,
props: SemanticsProps,
f: impl FnOnce(&mut Self, GlobalElementId) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn semantics_with_id<I>(
&mut self,
props: SemanticsProps,
f: impl FnOnce(&mut Self, GlobalElementId) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Creates a Semantics layout wrapper around the subtree and passes its element id.
See Self::semantics for guidance on when to use Semantics vs attach_semantics
(SemanticsDecoration).
pub fn opacity<I>(
&mut self,
opacity: f32,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn opacity_props<I>(
&mut self,
props: OpacityProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn foreground_scope<I>(
&mut self,
foreground: Color,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn foreground_scope_props<I>(
&mut self,
props: ForegroundScopeProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn effect_layer<I>(
&mut self,
mode: EffectMode,
chain: EffectChain,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn effect_layer_props<I>(
&mut self,
props: EffectLayerProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn backdrop_source_group_v1<I>(
&mut self,
pyramid: Option<CustomEffectPyramidRequestV1>,
quality: EffectQuality,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn backdrop_source_group_v1_props<I>(
&mut self,
props: BackdropSourceGroupProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn mask_layer<I>(
&mut self,
mask: Mask,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn mask_layer_props<I>(
&mut self,
props: MaskLayerProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn composite_group<I>(
&mut self,
mode: BlendMode,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn composite_group_props<I>(
&mut self,
props: CompositeGroupProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn visual_transform<I>(
&mut self,
transform: Transform2D,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn render_transform<I>(
&mut self,
transform: Transform2D,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn fractional_render_transform<I>(
&mut self,
translate_x_fraction: f32,
translate_y_fraction: f32,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn visual_transform_props<I>(
&mut self,
props: VisualTransformProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn render_transform_props<I>(
&mut self,
props: RenderTransformProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn fractional_render_transform_props<I>(
&mut self,
props: FractionalRenderTransformProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn anchored_props<I>(
&mut self,
props: AnchoredProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn interactivity_gate<I>(
&mut self,
present: bool,
interactive: bool,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn interactivity_gate_props<I>(
&mut self,
props: InteractivityGateProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn hit_test_gate<I>(
&mut self,
hit_test: bool,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn hit_test_gate_props<I>(
&mut self,
props: HitTestGateProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn focus_traversal_gate<I>(
&mut self,
traverse: bool,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn focus_traversal_gate_props<I>(
&mut self,
props: FocusTraversalGateProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn pressable<I>(
&mut self,
props: PressableProps,
f: impl FnOnce(&mut Self, PressableState) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn pressable_with_id<I>(
&mut self,
props: PressableProps,
f: impl FnOnce(&mut Self, PressableState, GlobalElementId) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn pressable_with_id_props<I>(
&mut self,
f: impl FnOnce(&mut Self, PressableState, GlobalElementId) -> (PressableProps, I),
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Sourcepub fn pressable_on_activate(&mut self, handler: OnActivate)
pub fn pressable_on_activate(&mut self, handler: OnActivate)
Register a component-owned activation handler for the current pressable element.
This is a policy hook mechanism (ADR 0074): components decide what activation does (model writes, overlay requests, command dispatch), while the runtime remains mechanism-only.
pub fn pressable_on_activate_for( &mut self, element: GlobalElementId, handler: OnActivate, )
pub fn pressable_add_on_activate(&mut self, handler: OnActivate)
pub fn pressable_add_on_activate_for( &mut self, element: GlobalElementId, handler: OnActivate, )
pub fn pressable_clear_on_activate(&mut self)
Sourcepub fn selectable_text_on_activate_span(
&mut self,
handler: OnSelectableTextActivateSpan,
)
pub fn selectable_text_on_activate_span( &mut self, handler: OnSelectableTextActivateSpan, )
Register a component-owned activation handler for interactive spans in the current selectable text element.
This is a policy hook mechanism (ADR 0074): components decide what activation does (open URL, dispatch command, etc.), while the runtime remains mechanism-only.
pub fn selectable_text_on_activate_span_for( &mut self, element: GlobalElementId, handler: OnSelectableTextActivateSpan, )
pub fn selectable_text_clear_on_activate_span(&mut self)
pub fn selectable_text_clear_on_activate_span_for( &mut self, element: GlobalElementId, )
Sourcepub fn pressable_on_pointer_down(&mut self, handler: OnPressablePointerDown)
pub fn pressable_on_pointer_down(&mut self, handler: OnPressablePointerDown)
Register a component-owned pointer down handler for the current pressable element.
This is a policy hook mechanism (ADR 0074): components can opt into Radix-style “select on mouse down” semantics without changing the default click-like activation behavior.
pub fn pressable_on_pointer_move(&mut self, handler: OnPressablePointerMove)
pub fn pressable_on_pointer_up(&mut self, handler: OnPressablePointerUp)
pub fn pressable_on_clipboard_write_completed( &mut self, handler: OnPressableClipboardWriteCompleted, )
pub fn pressable_on_pointer_down_for( &mut self, element: GlobalElementId, handler: OnPressablePointerDown, )
pub fn pressable_on_pointer_move_for( &mut self, element: GlobalElementId, handler: OnPressablePointerMove, )
pub fn pressable_on_pointer_up_for( &mut self, element: GlobalElementId, handler: OnPressablePointerUp, )
pub fn pressable_on_clipboard_write_completed_for( &mut self, element: GlobalElementId, handler: OnPressableClipboardWriteCompleted, )
pub fn pressable_add_on_pointer_down(&mut self, handler: OnPressablePointerDown)
pub fn pressable_add_on_pointer_move(&mut self, handler: OnPressablePointerMove)
pub fn pressable_add_on_pointer_up(&mut self, handler: OnPressablePointerUp)
pub fn pressable_add_on_pointer_down_for( &mut self, element: GlobalElementId, handler: OnPressablePointerDown, )
pub fn pressable_add_on_pointer_move_for( &mut self, element: GlobalElementId, handler: OnPressablePointerMove, )
pub fn pressable_add_on_pointer_up_for( &mut self, element: GlobalElementId, handler: OnPressablePointerUp, )
pub fn pressable_clear_on_pointer_down(&mut self)
pub fn pressable_clear_on_pointer_move(&mut self)
pub fn pressable_clear_on_pointer_up(&mut self)
pub fn pressable_clear_on_clipboard_write_completed(&mut self)
Sourcepub fn pressable_on_hover_change(&mut self, handler: OnHoverChange)
pub fn pressable_on_hover_change(&mut self, handler: OnHoverChange)
Register a component-owned hover change handler for the current pressable element.
This is a mechanism-only hook: the runtime tracks hover deterministically and invokes
component code on hover transitions, without baking hover policy into fret-ui.
pub fn pressable_add_on_hover_change(&mut self, handler: OnHoverChange)
pub fn pressable_clear_on_hover_change(&mut self)
pub fn pointer_region<I>(
&mut self,
props: PointerRegionProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn text_input_region<I>(
&mut self,
props: TextInputRegionProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn internal_drag_region<I>(
&mut self,
props: InternalDragRegionProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn internal_drag_region_on_internal_drag(&mut self, handler: OnInternalDrag)
pub fn internal_drag_region_clear_on_internal_drag(&mut self)
pub fn external_drag_region<I>(
&mut self,
props: ExternalDragRegionProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn external_drag_region_on_external_drag(&mut self, handler: OnExternalDrag)
pub fn external_drag_region_clear_on_external_drag(&mut self)
Sourcepub fn pointer_region_on_pointer_down(&mut self, handler: OnPointerDown)
pub fn pointer_region_on_pointer_down(&mut self, handler: OnPointerDown)
Register a component-owned pointer down handler for the current pointer region element.
This is a mechanism-only hook point: components decide what a pointer down does (open a context menu, start a drag, request focus, etc.), while the runtime remains policy-free.
pub fn pointer_region_add_on_pointer_down(&mut self, handler: OnPointerDown)
pub fn pointer_region_clear_on_pointer_down(&mut self)
Sourcepub fn pointer_region_on_pointer_move(&mut self, handler: OnPointerMove)
pub fn pointer_region_on_pointer_move(&mut self, handler: OnPointerMove)
Register a component-owned pointer move handler for the current pointer region element.
This hook is invoked when the pointer region receives PointerEvent::Move events via
normal hit-testing or pointer capture.
pub fn pointer_region_add_on_pointer_move(&mut self, handler: OnPointerMove)
pub fn pointer_region_clear_on_pointer_move(&mut self)
Sourcepub fn pointer_region_on_pointer_up(&mut self, handler: OnPointerUp)
pub fn pointer_region_on_pointer_up(&mut self, handler: OnPointerUp)
Register a component-owned pointer up handler for the current pointer region element.
This hook is invoked when the pointer region receives PointerEvent::Up events via
normal hit-testing or pointer capture.
Sourcepub fn pointer_region_on_pointer_cancel(&mut self, handler: OnPointerCancel)
pub fn pointer_region_on_pointer_cancel(&mut self, handler: OnPointerCancel)
Register a component-owned pointer cancel handler for the current pointer region element.
This hook is invoked when the runtime receives Event::PointerCancel for a pointer stream
that was previously interacting with this region (typically via pointer capture).
pub fn pointer_region_on_wheel(&mut self, handler: OnWheel)
pub fn pointer_region_on_pinch_gesture(&mut self, handler: OnPinchGesture)
pub fn pointer_region_add_on_pointer_up(&mut self, handler: OnPointerUp)
pub fn pointer_region_add_on_wheel(&mut self, handler: OnWheel)
pub fn pointer_region_add_on_pinch_gesture(&mut self, handler: OnPinchGesture)
pub fn pointer_region_clear_on_pointer_up(&mut self)
pub fn pointer_region_clear_on_wheel(&mut self)
pub fn pointer_region_clear_on_pinch_gesture(&mut self)
pub fn text_input_region_on_text_input( &mut self, handler: OnTextInputRegionTextInput, )
pub fn text_input_region_clear_on_text_input(&mut self)
pub fn text_input_region_on_ime(&mut self, handler: OnTextInputRegionIme)
pub fn text_input_region_clear_on_ime(&mut self)
pub fn text_input_region_on_clipboard_read_text( &mut self, handler: OnTextInputRegionClipboardReadText, )
pub fn text_input_region_clear_on_clipboard_read_text(&mut self)
pub fn text_input_region_on_clipboard_read_failed( &mut self, handler: OnTextInputRegionClipboardReadFailed, )
pub fn text_input_region_clear_on_clipboard_read_failed(&mut self)
pub fn text_input_region_on_set_selection( &mut self, handler: OnTextInputRegionSetSelection, )
pub fn text_input_region_clear_on_set_selection(&mut self)
pub fn text_input_region_on_platform_text_input_query( &mut self, handler: OnTextInputRegionPlatformTextInputQuery, )
pub fn text_input_region_clear_on_platform_text_input_query(&mut self)
pub fn text_input_region_on_platform_text_input_replace_text_in_range_utf16( &mut self, handler: OnTextInputRegionPlatformTextInputReplaceTextInRangeUtf16, )
pub fn text_input_region_clear_on_platform_text_input_replace_text_in_range_utf16( &mut self, )
pub fn text_input_region_on_platform_text_input_replace_and_mark_text_in_range_utf16( &mut self, handler: OnTextInputRegionPlatformTextInputReplaceAndMarkTextInRangeUtf16, )
pub fn text_input_region_clear_on_platform_text_input_replace_and_mark_text_in_range_utf16( &mut self, )
pub fn key_on_key_down_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_on_key_down_focused_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_add_on_key_down_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_prepend_on_key_down_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_clear_on_key_down_for(&mut self, element: GlobalElementId)
pub fn key_clear_on_key_down_focused_for(&mut self, element: GlobalElementId)
pub fn key_on_key_down_capture_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_add_on_key_down_capture_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_prepend_on_key_down_capture_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )
pub fn key_clear_on_key_down_capture_for(&mut self, element: GlobalElementId)
pub fn command_on_command_for( &mut self, element: GlobalElementId, handler: OnCommand, )
pub fn action_on_command_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommand, )
pub fn action_add_on_command_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommand, )
pub fn action_clear_on_command_for_owner<Owner: Any>( &mut self, element: GlobalElementId, )
pub fn command_add_on_command_for( &mut self, element: GlobalElementId, handler: OnCommand, )
pub fn command_prepend_on_command_for( &mut self, element: GlobalElementId, handler: OnCommand, )
pub fn command_clear_on_command_for(&mut self, element: GlobalElementId)
pub fn command_on_command_availability_for( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )
pub fn action_on_command_availability_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )
pub fn action_add_on_command_availability_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )
pub fn action_clear_on_command_availability_for_owner<Owner: Any>( &mut self, element: GlobalElementId, )
pub fn command_add_on_command_availability_for( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )
pub fn command_prepend_on_command_availability_for( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )
pub fn command_clear_on_command_availability_for( &mut self, element: GlobalElementId, )
pub fn timer_on_timer_for(&mut self, element: GlobalElementId, handler: OnTimer)
pub fn timer_add_on_timer_for( &mut self, element: GlobalElementId, handler: OnTimer, )
pub fn timer_clear_on_timer_for(&mut self, element: GlobalElementId)
Sourcepub fn dismissible_on_dismiss_request(&mut self, handler: OnDismissRequest)
pub fn dismissible_on_dismiss_request(&mut self, handler: OnDismissRequest)
Register a component-owned dismiss handler for the current dismissible root element.
This is intended for overlay policy code that composes
render_dismissible_root_with_hooks(...) and
wants full control over dismissal semantics (ADR 0074).
Sourcepub fn dismissible_on_pointer_move(&mut self, handler: OnDismissiblePointerMove)
pub fn dismissible_on_pointer_move(&mut self, handler: OnDismissiblePointerMove)
Register a component-owned pointer-move observer for the current dismissible root element.
This is used for overlay policies that need global pointer movement (e.g. submenu safe-hover corridors) without making the overlay hit-testable outside its content.
pub fn dismissible_add_on_dismiss_request(&mut self, handler: OnDismissRequest)
pub fn dismissible_add_on_pointer_move( &mut self, handler: OnDismissiblePointerMove, )
pub fn dismissible_clear_on_dismiss_request(&mut self)
pub fn dismissible_clear_on_pointer_move(&mut self)
Sourcepub fn roving_on_active_change(&mut self, handler: OnRovingActiveChange)
pub fn roving_on_active_change(&mut self, handler: OnRovingActiveChange)
Register a component-owned roving active-change handler for the current roving element.
This hook is invoked when the roving container changes focus among its children due to keyboard navigation (arrow keys, Home/End, or typeahead).
Components can implement “automatic activation” (e.g. Tabs) by updating selection models here, keeping selection policy out of the runtime (ADR 0074).
pub fn roving_add_on_active_change(&mut self, handler: OnRovingActiveChange)
pub fn roving_clear_on_active_change(&mut self)
Sourcepub fn roving_on_typeahead(&mut self, handler: OnRovingTypeahead)
pub fn roving_on_typeahead(&mut self, handler: OnRovingTypeahead)
Register a component-owned roving typeahead handler for the current roving element.
When set, the runtime forwards alphanumeric key presses to this handler so components can decide how typeahead should work (buffering, prefix matching, wrapping, etc.).
pub fn roving_add_on_typeahead(&mut self, handler: OnRovingTypeahead)
pub fn roving_clear_on_typeahead(&mut self)
pub fn roving_on_key_down(&mut self, handler: OnKeyDown)
pub fn roving_add_on_key_down(&mut self, handler: OnKeyDown)
pub fn roving_clear_on_key_down(&mut self)
Register a component-owned roving navigation handler for the current roving element.
This is invoked for key down events that bubble through the roving container so component code can decide which child should become focused (arrow keys, Home/End, etc.).
pub fn stack<I>(&mut self, f: impl FnOnce(&mut Self) -> I) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn stack_props<I>(
&mut self,
props: StackProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn column<I>(
&mut self,
props: ColumnProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn row<I>(
&mut self,
props: RowProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn spacer(&mut self, props: SpacerProps) -> AnyElement
pub fn text(&mut self, text: impl Into<Arc<str>>) -> AnyElement
pub fn text_props(&mut self, props: TextProps) -> AnyElement
pub fn styled_text(&mut self, rich: AttributedText) -> AnyElement
pub fn styled_text_props(&mut self, props: StyledTextProps) -> AnyElement
pub fn selectable_text(&mut self, rich: AttributedText) -> AnyElement
pub fn selectable_text_with_id_props( &mut self, f: impl FnOnce(&mut Self, GlobalElementId) -> SelectableTextProps, ) -> AnyElement
pub fn selectable_text_props( &mut self, props: SelectableTextProps, ) -> AnyElement
pub fn text_input(&mut self, props: TextInputProps) -> AnyElement
pub fn text_input_with_id_props( &mut self, f: impl FnOnce(&mut Self, GlobalElementId) -> TextInputProps, ) -> AnyElement
pub fn text_area(&mut self, props: TextAreaProps) -> AnyElement
pub fn text_area_with_id_props( &mut self, f: impl FnOnce(&mut Self, GlobalElementId) -> TextAreaProps, ) -> AnyElement
pub fn resizable_panel_group<I>(
&mut self,
props: ResizablePanelGroupProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn image(&mut self, image: ImageId) -> AnyElement
pub fn image_props(&mut self, props: ImageProps) -> AnyElement
pub fn canvas( &mut self, props: CanvasProps, paint: impl for<'p> Fn(&mut CanvasPainter<'p>) + 'static, ) -> AnyElement
pub fn viewport_surface(&mut self, target: RenderTargetId) -> AnyElement
pub fn viewport_surface_mapped( &mut self, target: RenderTargetId, target_px_size: (u32, u32), fit: ViewportFit, ) -> AnyElement
pub fn viewport_surface_props( &mut self, props: ViewportSurfaceProps, ) -> AnyElement
pub fn svg_icon(&mut self, svg: SvgSource) -> AnyElement
pub fn svg_icon_props(&mut self, props: SvgIconProps) -> AnyElement
pub fn spinner(&mut self) -> AnyElement
pub fn spinner_props(&mut self, props: SpinnerProps) -> AnyElement
pub fn hover_region<I>(
&mut self,
props: HoverRegionProps,
f: impl FnOnce(&mut Self, bool) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn wheel_region<I>(
&mut self,
props: WheelRegionProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn scroll<I>(
&mut self,
props: ScrollProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn scrollbar(&mut self, props: ScrollbarProps) -> AnyElement
pub fn virtual_list<F, I>( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, f: F, ) -> AnyElement
pub fn virtual_list_with_range_extractor<F, I>( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, range_extractor: impl FnOnce(VirtualRange) -> Vec<usize>, f: F, ) -> AnyElement
pub fn virtual_list_with_layout<F, I>( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, f: F, ) -> AnyElement
pub fn virtual_list_with_layout_and_range_extractor<F, I>( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, range_extractor: impl FnOnce(VirtualRange) -> Vec<usize>, f: F, ) -> AnyElement
pub fn flex<I>(
&mut self,
props: FlexProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn roving_flex<I>(
&mut self,
props: RovingFlexProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
pub fn grid<I>(
&mut self,
props: GridProps,
f: impl FnOnce(&mut Self) -> I,
) -> AnyElementwhere
I: IntoIterator<Item = AnyElement>,
Sourcepub fn virtual_list_keyed(
&mut self,
len: usize,
options: VirtualListOptions,
scroll_handle: &VirtualListScrollHandle,
key_at: impl FnMut(usize) -> ItemKey,
row: impl FnMut(&mut Self, usize) -> AnyElement,
) -> AnyElement
pub fn virtual_list_keyed( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl FnMut(usize) -> ItemKey, row: impl FnMut(&mut Self, usize) -> AnyElement, ) -> AnyElement
Virtualized list helper that enforces stable element identity by entering a keyed scope for each visible row.
Prefer this over index-identity list rendering for any dynamic collection that can reorder, so element-local state (caret/selection/scroll) does not “stick to positions”.
Sourcepub fn virtual_list_keyed_retained(
&mut self,
len: usize,
options: VirtualListOptions,
scroll_handle: &VirtualListScrollHandle,
key_at: Arc<dyn Fn(usize) -> ItemKey>,
row: Arc<dyn for<'a> Fn(&mut ElementContext<'a, H>, usize) -> AnyElement>,
) -> AnyElementwhere
H: 'static,
pub fn virtual_list_keyed_retained(
&mut self,
len: usize,
options: VirtualListOptions,
scroll_handle: &VirtualListScrollHandle,
key_at: Arc<dyn Fn(usize) -> ItemKey>,
row: Arc<dyn for<'a> Fn(&mut ElementContext<'a, H>, usize) -> AnyElement>,
) -> AnyElementwhere
H: 'static,
Retained-host VirtualList helper (ADR 0192).
This is an opt-in surface that stores 'static row callbacks in element-local state so
the runtime can attach/detach row subtrees when a cache root reuses without rerendering.