pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn new() -> Self
pub fn add_window(&mut self, builder: WindowBuilder) -> Result<WindowId>
Sourcepub fn clipboard(&self) -> Clipboard
pub fn clipboard(&self) -> Clipboard
Shared clipboard handle used by every window in this runtime.
Sourcepub fn set_clipboard_backend(&self, backend: impl ClipboardBackend + 'static)
pub fn set_clipboard_backend(&self, backend: impl ClipboardBackend + 'static)
Install a clipboard storage driver (for example an OS-clipboard bridge provided by the platform). Existing windows pick it up immediately.
pub fn remove_window(&mut self, window_id: WindowId) -> Result<()>
pub fn handle_event(&mut self, window_id: WindowId, event: Event) -> Result<()>
Sourcepub fn handle_semantics_action(
&mut self,
window_id: WindowId,
target: WidgetId,
action: SemanticsActionRequest,
) -> Result<bool>
pub fn handle_semantics_action( &mut self, window_id: WindowId, target: WidgetId, action: SemanticsActionRequest, ) -> Result<bool>
Invoke an action advertised by a node in the latest semantic snapshot.
The semantic node does not need to be a retained WidgetPod. Virtual
and generated nodes are routed to their nearest graph-backed semantic
ancestor while SemanticsEvent::target preserves the original node
identity for widget-local dispatch. The return value is false when the
node is stale, hidden, disabled, does not advertise the action, or no
widget handles an action without a built-in runtime fallback.
pub fn tick(&mut self, frame_time: f64)
pub fn drain_ready_events(&mut self) -> Vec<(WindowId, Event)>
pub fn next_wakeup_time(&self, window_id: WindowId) -> Result<Option<f64>>
pub fn wake_async( &mut self, window_id: WindowId, token: AsyncWakeToken, ) -> Result<bool>
Sourcepub fn wake_root(&mut self, window_id: WindowId) -> Result<()>
pub fn wake_root(&mut self, window_id: WindowId) -> Result<()>
Deliver an external-wake Event::Custom (kind EXTERNAL_WAKE_KIND) to a window’s
root widget. Used by the platform to translate a background-thread wake into a UI event,
so widgets can drain channels / async results. Routed to the root and its effects
(invalidations, wake requests) applied like any other event.