Skip to main content

Module runtime

Module runtime 

Source

Structs§

BringIntoViewRequester
A handle that can programmatically scroll a widget into view.
ComposeGuard
Composer
FocusManager
A manager for programmatic focus navigation.
FocusRequester
A handle that can programmatically request focus for a widget.
Frame
Frame - output of composition for a tick: scene + input/semantics.
HitRegion
Hit-test region in physical pixels (rect carries px magnitudes, like Compose Rect).
Scheduler
SchedulerScopeGuard
RAII guard from Scheduler::scope_guard. Pops the scope on drop.
SchedulerScopeGuardRaw
Panic-safe scope guard that does NOT hold a borrow across the body.
SemNode
Flattened semantics node produced by layout_and_paint.

Enums§

FocusDirection
Direction for focus movement.

Constants§

CLEAR_FOCUS_MARKER
COMPOSER

Functions§

drain_bring_into_view_requests
Drain all queued bring-into-view requests in FIFO order.
drain_focus_requests
Drain all queued focus requests in FIFO order.
focus_capture
Currently captured focus target, if any.
focus_group_chain
Sub-chain of ids sharing the focused element’s focus group. Returns None when focus is outside any group (full chain applies). Tab and spatial navigation both scope to this so modals trap focus.
keyed
queue_bring_into_view
Enqueue a bring-into-view request for a view id. The request is consumed once, on the next frame, against the most recently painted hit regions.
remember
Slot-based remember (sequential composition only). This prevents state aliasing when the composition tree structure changes between frames
remember_auto
Auto-keyed variant of remember: identity is the call site plus an occurrence index, so state follows a composition position, not an item. Only safe where the number of calls at this site is fixed across frames — list items and conditional branches need remember_with_key.
remember_state
Raw slot state (Rc<RefCell<T>>). Writes via borrow_mut() don’t request a frame - prefer [remember_mutable] if a write must always recompose.
remember_state_auto
Auto-keyed variant of remember_state. Same positional caveat as remember_auto and the same no-frame-on-write caveat as remember_state.
remember_state_with_key
Key-based variant of remember_state. Same no-frame-on-write caveat.
remember_with_key
Key-based remember.
route_action_to_point
Route a gesture action to the topmost hit region under center, walking up ancestors until one consumes it. Fallback for gestures that miss the focused widget, matching Compose routing to the node under the pointer. Coordinates are physical px, like HitRegion::rect.
set_focus_order
Record the focusable ids in declaration/layout order for the frame being painted. Called by the layout engine before hit regions are reordered for hit testing.
shutdown_composition
Dispose the root composition scope and clear all composer caches.
spatial_focus_next
Find the next focusable element in a given spatial direction.
take_focus_order
Take the focus order captured by the last paint, if any.
take_focus_request
take_focus_target_remaps
Drain the focus-target remaps recorded during this frame’s layout.
unique_component_id
Returns a fresh unique component id. See [COMPONENT_ID].