pub struct Context { /* private fields */ }Expand description
Ambient framework-managed UI context binding the active SceneHandle, responsive signals, and platform metadata.
Implementations§
Source§impl Context
High-level declarative building helpers on Context.
impl Context
High-level declarative building helpers on Context.
Sourcepub fn new(scene: SceneHandle, platform: PlatformKind) -> Self
pub fn new(scene: SceneHandle, platform: PlatformKind) -> Self
Sourcepub fn safe_area_signal(&self) -> Signal<SafeAreaInsets>
pub fn safe_area_signal(&self) -> Signal<SafeAreaInsets>
Sourcepub fn safe_area(&self) -> SafeAreaInsets
pub fn safe_area(&self) -> SafeAreaInsets
Sourcepub fn immersive_fullscreen_signal(&self) -> Signal<bool>
pub fn immersive_fullscreen_signal(&self) -> Signal<bool>
Sourcepub fn is_immersive_fullscreen(&self) -> bool
pub fn is_immersive_fullscreen(&self) -> bool
Sourcepub fn set_immersive_fullscreen(&self, enabled: bool)
pub fn set_immersive_fullscreen(&self, enabled: bool)
Explicitly sets immersive fullscreen state across both reactive UI chrome and OS system bars.
§Arguments
&Self- Context reference.bool-trueto enter immersive fullscreen;falseto exit and restore bars.
Sourcepub fn enter_immersive_fullscreen(&self)
pub fn enter_immersive_fullscreen(&self)
Increments the nested immersive fullscreen entry count and activates fullscreen mode.
§Arguments
&Self- Context reference.
Sourcepub fn exit_immersive_fullscreen(&self)
pub fn exit_immersive_fullscreen(&self)
Decrements the nested immersive fullscreen entry count and restores bars when the count reaches zero.
§Arguments
&Self- Context reference.
Sourcepub fn app_state_signal(&self) -> Signal<AppState>
pub fn app_state_signal(&self) -> Signal<AppState>
Sourcepub fn emit_page_appear(&self)
pub fn emit_page_appear(&self)
Dispatches a page-level SystemEvent::Appear to all currently active non-frozen hooks and visible observers.
§Arguments
&Self- Context reference.
Sourcepub fn emit_page_disappear(&self)
pub fn emit_page_disappear(&self)
Dispatches a page-level SystemEvent::Disappear to all currently active non-frozen hooks and visible observers.
§Arguments
&Self- Context reference.
Sourcepub fn emit_subtree_appear(&self, root: NodeId)
pub fn emit_subtree_appear(&self, root: NodeId)
Dispatches SystemEvent::Appear strictly to Lifecycle components and scoped hooks within root’s subtree.
§Arguments
&Self- Context reference.NodeId- Routed page or component subtree root handle becoming active.
Sourcepub fn emit_subtree_disappear(&self, root: NodeId)
pub fn emit_subtree_disappear(&self, root: NodeId)
Dispatches SystemEvent::Disappear strictly to Lifecycle components and scoped hooks within root’s subtree.
§Arguments
&Self- Context reference.NodeId- Routed page or component subtree root handle becoming hidden.
Sourcepub fn elapsed_ms(&self) -> u64
pub fn elapsed_ms(&self) -> u64
Sourcepub fn request_exit(&self)
pub fn request_exit(&self)
Requests graceful OS-level application termination across all platforms.
§Arguments
&Self- Context reference.
Sourcepub fn copy_to_clipboard(&self, text: &str) -> bool
pub fn copy_to_clipboard(&self, text: &str) -> bool
Sourcepub fn reactive_text<F>(&mut self, style: Style, producer: F) -> NodeId
pub fn reactive_text<F>(&mut self, style: Style, producer: F) -> NodeId
Sourcepub fn scroll_view(&mut self, style: Style) -> NodeId
pub fn scroll_view(&mut self, style: Style) -> NodeId
Sourcepub fn input(&mut self, state: InputNodeState, style: Style) -> NodeId
pub fn input(&mut self, state: InputNodeState, style: Style) -> NodeId
Sourcepub fn image(&mut self, buffer: ImageBuffer, style: Style) -> NodeId
pub fn image(&mut self, buffer: ImageBuffer, style: Style) -> NodeId
Sourcepub fn append(&mut self, parent: NodeId, child: NodeId)
pub fn append(&mut self, parent: NodeId, child: NodeId)
Appends child to parent.
§Arguments
&Self- Build context.NodeId- Parent container.NodeId- Child node.
Sourcepub fn append_many(&mut self, parent: NodeId, children: &[NodeId])
pub fn append_many(&mut self, parent: NodeId, children: &[NodeId])
Appends a slice of children to parent under a single scene write lock and dirty pass.
§Arguments
&Self- Build context.NodeId- Parent container.&[NodeId]- Ordered child node slice.
Sourcepub fn bind_style<F>(&mut self, node_id: NodeId, producer: F)
pub fn bind_style<F>(&mut self, node_id: NodeId, producer: F)
Binds a reactive Style closure to node_id and attaches its disposal Scope automatically.
§Arguments
&Self- Build context.NodeId- Target scene node.F- ReactiveStyleproducer closure.
Sourcepub fn on_pointer_enter<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_pointer_enter<F>(&mut self, node_id: NodeId, callback: F)
Registers a pointer-enter handler on node_id.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Pointer-enter callback closure.
Sourcepub fn on_pointer_leave<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_pointer_leave<F>(&mut self, node_id: NodeId, callback: F)
Registers a pointer-leave handler on node_id.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Pointer-leave callback closure.
Sourcepub fn on_focus<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_focus<F>(&mut self, node_id: NodeId, callback: F)
Registers a focus-gained handler on node_id and marks it focusable.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Focus callback closure receivingUiEventKind::Focus.
Sourcepub fn on_blur<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_blur<F>(&mut self, node_id: NodeId, callback: F)
Registers a focus-lost handler on node_id.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Blur callback closure receivingUiEventKind::Blur.
Sourcepub fn set_focusable(&mut self, node_id: NodeId, focusable: bool)
pub fn set_focusable(&mut self, node_id: NodeId, focusable: bool)
Configures whether node_id participates in keyboard focus navigation.
§Arguments
&Self- Build context.NodeId- Target node handle.bool- Whether keyboard focus is enabled.
Sourcepub fn on_click<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_click<F>(&mut self, node_id: NodeId, callback: F)
Registers a click handler on node_id and sets pointer cursor automatically.
§Arguments
&Self- Build context.NodeId- Target node.F- Click callback closure.
Sourcepub fn on_change<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_change<F>(&mut self, node_id: NodeId, callback: F)
Registers a change handler on an Input node.
§Arguments
&Self- Build context.NodeId- Target input node.F- Change callback closure.
Sourcepub fn set_a11y(&mut self, node_id: NodeId, props: A11yProps)
pub fn set_a11y(&mut self, node_id: NodeId, props: A11yProps)
Attaches semantic accessibility properties to node_id.
§Arguments
&Self- Build context.NodeId- Target scene node.A11yProps- Semantic role, label, hint, and state metadata.
Sourcepub fn on_scroll<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_scroll<F>(&mut self, node_id: NodeId, callback: F)
Registers a scroll handler on a scrollable container node.
§Arguments
&Self- Build context.NodeId- Target scroll container node.F- Scroll callback closure receivingUiEventKind::Scroll(delta).
Sourcepub fn on_pointer_down<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_pointer_down<F>(&mut self, node_id: NodeId, callback: F)
Registers a pointer-down handler on node_id for draggable interactive controls.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Pointer-down callback closure.
Sourcepub fn on_pointer_move<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_pointer_move<F>(&mut self, node_id: NodeId, callback: F)
Registers a pointer-move handler on node_id receiving captured drag coordinates while pressed.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Pointer-move callback closure.
Sourcepub fn on_pointer_up<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_pointer_up<F>(&mut self, node_id: NodeId, callback: F)
Registers a pointer-up handler on node_id invoked when drag capture releases.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Pointer-up callback closure.
Sourcepub fn on_pointer_cancel<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_pointer_cancel<F>(&mut self, node_id: NodeId, callback: F)
Registers a pointer-cancel handler on node_id invoked when OS or gesture arbitration cancels a press.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Pointer-cancel callback closure receivingUiEventKind::PointerCancel.
Sourcepub fn on_hover<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_hover<F>(&mut self, node_id: NodeId, callback: F)
Registers a hover handler on node_id invoked on both PointerEnter and PointerLeave.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Hover callback closure receivingUiEventKind::PointerEnterorPointerLeave.
Sourcepub fn on_key<F>(&mut self, node_id: NodeId, callback: F)
pub fn on_key<F>(&mut self, node_id: NodeId, callback: F)
Registers a keyboard key-down handler on node_id and marks it focusable.
§Arguments
&Self- Build context.NodeId- Target node handle.F- Key-down callback closure receivingUiEventKind::KeyDown.
Sourcepub fn set_virtual_scroll(
&mut self,
node_id: NodeId,
scroll_y: f32,
content_height: f32,
)
pub fn set_virtual_scroll( &mut self, node_id: NodeId, scroll_y: f32, content_height: f32, )
Records virtualized scroll progress on node_id so the overlay scrollbar tracks accurately.
§Arguments
&Self- Build context.NodeId- Target virtualized scroll container.f32- Active virtual vertical scroll offset in logical pixels.f32- Full virtualized content height in logical pixels.
Sourcepub fn set_scroll_offset(&mut self, node_id: NodeId, offset: Point)
pub fn set_scroll_offset(&mut self, node_id: NodeId, offset: Point)
Sets the concrete inner pixel scroll offset on node_id (used by virtualized lists for sub-pixel alignment).
§Arguments
&Self- Build context.NodeId- Target scroll container.Point- Scroll offset(x, y)in logical pixels.
Sourcepub fn start_transition(&mut self, transition: NodeTransition)
pub fn start_transition(&mut self, transition: NodeTransition)
Starts a smooth paint/transform transition on transition.get_node().
§Arguments
&Self- Build context.NodeTransition- Transition specification.
Sourcepub fn bind_children<F>(&mut self, host: NodeId, builder: F)
pub fn bind_children<F>(&mut self, host: NodeId, builder: F)
Mounts a reactive dynamic subtree whose children rebuild cleanly inside an isolated Scope.
§Arguments
&Self- Build context.NodeId- Host container node.F- Reactive zero-ctxbuilder returning childNodeIdvalues.