pub struct App { /* private fields */ }Expand description
Unified cross-platform application runtime orchestrating platform events, reactivity, layout, and rendering.
Implementations§
Source§impl App
Core lifecycle, event dispatch, and frame rendering pipeline for App.
impl App
Core lifecycle, event dispatch, and frame rendering pipeline for App.
Sourcepub fn new(config: AppConfig) -> Result<Self, PlatformError>
pub fn new(config: AppConfig) -> Result<Self, PlatformError>
Sourcepub fn headless(config: AppConfig) -> Result<Self, PlatformError>
pub fn headless(config: AppConfig) -> Result<Self, PlatformError>
Sourcepub fn with_platform(
config: AppConfig,
platform: Box<dyn PlatformBackend>,
) -> Result<Self, PlatformError>
pub fn with_platform( config: AppConfig, platform: Box<dyn PlatformBackend>, ) -> Result<Self, PlatformError>
Sourcepub fn set_partial_layout_damage(&mut self, enabled: bool)
pub fn set_partial_layout_damage(&mut self, enabled: bool)
Enables or disables surgical partial-layout conservative bounds diffing (default true; disable for full-redraw A/B comparisons).
§Arguments
&Self- Mutable application.bool-truefor surgical partial-layout damage;falseto promote any layout pass to full-viewport redraw.
Sourcepub fn is_partial_layout_damage_enabled(&self) -> bool
pub fn is_partial_layout_damage_enabled(&self) -> bool
Sourcepub fn set_telemetry_enabled(&mut self, enabled: bool)
pub fn set_telemetry_enabled(&mut self, enabled: bool)
Enables or disables opt-in per-phase microsecond timing instrumentation inside step_frame.
§Arguments
&Self- Mutable application.bool-trueto capture microsecond phase timings;falsefor zero-syscall default execution.
Sourcepub fn is_telemetry_enabled(&self) -> bool
pub fn is_telemetry_enabled(&self) -> bool
Sourcepub fn last_frame_telemetry(&self) -> FrameTelemetry
pub fn last_frame_telemetry(&self) -> FrameTelemetry
Sourcepub fn present_fps(&self) -> f32
pub fn present_fps(&self) -> f32
Sourcepub fn display_refresh_rate_hz(&self) -> f32
pub fn display_refresh_rate_hz(&self) -> f32
Sourcepub fn update_display_refresh_rate_hz(&mut self, hz: f32)
pub fn update_display_refresh_rate_hz(&mut self, hz: f32)
Updates the detected native hardware display refresh rate reported by an OS or browser host.
§Arguments
&Self- Mutable application.f32- Measured or queried display refresh rate in Hertz.
Sourcepub fn report_host_refresh_rate(&mut self, measured_hz: f32)
pub fn report_host_refresh_rate(&mut self, measured_hz: f32)
Reports live host VSync / requestAnimationFrame cadence when the scene is idle so telemetry reflects the real display rate.
§Arguments
&Self- Mutable application.f32- Measured host presentation cadence in Hertz.
Sourcepub fn is_ime_active(&self) -> bool
pub fn is_ime_active(&self) -> bool
Sourcepub fn last_frame_damage(&self) -> DamageRegion
pub fn last_frame_damage(&self) -> DamageRegion
Sourcepub fn read_clipboard(&self) -> Option<String>
pub fn read_clipboard(&self) -> Option<String>
Sourcepub fn write_clipboard(&mut self, text: &str) -> Result<(), PlatformError>
pub fn write_clipboard(&mut self, text: &str) -> Result<(), PlatformError>
Sourcepub fn app_state_signal(&self) -> Signal<AppState>
pub fn app_state_signal(&self) -> Signal<AppState>
Sourcepub fn safe_area_signal(&self) -> Signal<SafeAreaInsets>
pub fn safe_area_signal(&self) -> Signal<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(&mut self, enabled: bool)
pub fn set_immersive_fullscreen(&mut self, enabled: bool)
Toggles immersive fullscreen mode, updating reactive UI chrome state and enqueuing platform fullscreen commands.
§Arguments
&Self- Mutable application.bool-trueto enter edge-to-edge immersive fullscreen;falseto exit and restore bars.
Sourcepub fn active_gesture(&self) -> ActiveGesture
pub fn active_gesture(&self) -> ActiveGesture
Sourcepub fn is_background_frozen(&self) -> bool
pub fn is_background_frozen(&self) -> bool
Sourcepub fn should_pump_frames(&self) -> bool
pub fn should_pump_frames(&self) -> bool
Sourcepub fn is_platform_frame_pump_paused(&self) -> bool
pub fn is_platform_frame_pump_paused(&self) -> bool
Sourcepub fn wait_background_events(&mut self) -> Result<FrameStats, PlatformError>
pub fn wait_background_events(&mut self) -> Result<FrameStats, PlatformError>
Blocks on OS lifecycle events with zero CPU usage while background-frozen and renders a restored frame immediately upon waking to foreground.
§Arguments
&Self- Mutable application.
§Returns
Result<FrameStats, PlatformError>- Zeroed idle stats while still backgrounded, or restored frame stats after waking.
Sourcepub fn dispatch_system_event(&mut self, event: SystemEvent)
pub fn dispatch_system_event(&mut self, event: SystemEvent)
Normalizes a raw SystemEvent through SystemEventNormalizer, updates reactive Context signals, and notifies all active hooks and visible Lifecycle components.
§Arguments
&Self- Mutable application.SystemEvent- Incoming platform or synthetic system event.
Sourcepub fn copy_selection(&mut self) -> Option<String>
pub fn copy_selection(&mut self) -> Option<String>
Sourcepub fn set_fps_limit(&mut self, limit: Option<u32>)
pub fn set_fps_limit(&mut self, limit: Option<u32>)
Configures the cross-platform maximum frame rate (None = unlimited maximum FPS, the default).
§Arguments
&Self- Mutable application.Option<u32>- Target FPS cap (Some(1..=1000)orNonefor uncapped maximum FPS).
Sourcepub fn attach_game_host(&mut self, host: GameEngineHost)
pub fn attach_game_host(&mut self, host: GameEngineHost)
Registers a GameEngineHost so all incoming OS/Web WindowEvents are automatically forwarded to its InputState.
§Arguments
&Self- Mutable application.GameEngineHost- Game engine host handle to attach.
Sourcepub fn has_active_animations(&self) -> bool
pub fn has_active_animations(&self) -> bool
Sourcepub fn platform_kind(&self) -> PlatformKind
pub fn platform_kind(&self) -> PlatformKind
Sourcepub fn platform_capabilities(&self) -> PlatformCapabilities
pub fn platform_capabilities(&self) -> PlatformCapabilities
Sourcepub fn raw_window_handle(&self) -> RawWindowHandle
pub fn raw_window_handle(&self) -> RawWindowHandle
Sourcepub fn set_render_mode(&mut self, mode: RenderMode)
pub fn set_render_mode(&mut self, mode: RenderMode)
Dynamically switches the rendering pipeline mode (Auto, Software, Hardware, Hybrid).
§Arguments
&Self- Mutable app.RenderMode- Target render mode.
Sourcepub fn queue_window_command(&mut self, command: WindowCommand)
pub fn queue_window_command(&mut self, command: WindowCommand)
Queues a WindowCommand for immediate dispatch on the next frame tick.
§Arguments
&Self- Mutable app.WindowCommand- Command to queue.
Sourcepub fn set_exact_physical_viewport(
&mut self,
phys_w: u32,
phys_h: u32,
scale: f32,
)
pub fn set_exact_physical_viewport( &mut self, phys_w: u32, phys_h: u32, scale: f32, )
Sets exact physical pixel surface dimensions and DPI scale without truncating fractional logical sizes.
§Arguments
&Self- Mutable app.u32- Exact physical surface width in device pixels.u32- Exact physical surface height in device pixels.f32- Active display DPI scale factor.
Sourcepub fn dispatch_window_event(&mut self, event: WindowEvent)
pub fn dispatch_window_event(&mut self, event: WindowEvent)
Processes a single incoming WindowEvent, updating state, hit-testing, and dispatching UI callbacks.
§Arguments
&Self- Mutable app.WindowEvent- Event received from the OS or test harness.
Sourcepub fn step_frame(&mut self) -> Result<FrameStats, PlatformError>
pub fn step_frame(&mut self) -> Result<FrameStats, PlatformError>
Sourcepub fn step_game_frame(
&mut self,
dt_secs: f32,
) -> Result<FrameStats, PlatformError>
pub fn step_game_frame( &mut self, dt_secs: f32, ) -> Result<FrameStats, PlatformError>
Sourcepub fn run_frames(
&mut self,
max_frames: Option<u64>,
) -> Result<FrameStats, PlatformError>
pub fn run_frames( &mut self, max_frames: Option<u64>, ) -> Result<FrameStats, PlatformError>
Sourcepub fn cancel_all_active_pointers(&mut self)
pub fn cancel_all_active_pointers(&mut self)
Cancels all active pointer/touch contacts and resets transient gesture, drag, hover, and pressed UI state.
§Arguments
&Self- Mutable app.
Sourcepub fn reconcile_active_touch_ids(&mut self, live_ids: &[u64])
pub fn reconcile_active_touch_ids(&mut self, live_ids: &[u64])
Reconciles active touch contacts against the OS ground-truth live pointer ID list, pruning any stale/missed touches.
§Arguments
&Self- Mutable app.&[u64]- Currently active OS touch pointer identifiers.