Skip to main content

HostController

Trait HostController 

Source
pub trait HostController: Send + Sync {
    // Required methods
    fn set_keep_screen_on(&self, enabled: bool);
    fn platform_directories(&self) -> Option<PlatformDirectories>;
    fn exit(&self);
    fn background(&self);

    // Provided method
    fn durable_save_deadline(&self) -> Duration { ... }
}
Expand description

Host operations supplied by the framework platform backend.

Required Methods§

Source

fn set_keep_screen_on(&self, enabled: bool)

Keeps the host window awake while enabled.

Source

fn platform_directories(&self) -> Option<PlatformDirectories>

Returns platform directory roots inside the application’s host sandbox.

Source

fn exit(&self)

Finishes/backgrounds the host.

Source

fn background(&self)

Requests that the app move to the background.

Provided Methods§

Source

fn durable_save_deadline(&self) -> Duration

How long this host will wait for durable saves before it suspends the app. Android’s onPause and iOS’s background transition each allow a short, platform-defined budget; work that overruns it keeps running under a background-work lease.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§