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§
Sourcefn set_keep_screen_on(&self, enabled: bool)
fn set_keep_screen_on(&self, enabled: bool)
Keeps the host window awake while enabled.
Sourcefn platform_directories(&self) -> Option<PlatformDirectories>
fn platform_directories(&self) -> Option<PlatformDirectories>
Returns platform directory roots inside the application’s host sandbox.
Sourcefn background(&self)
fn background(&self)
Requests that the app move to the background.
Provided Methods§
Sourcefn durable_save_deadline(&self) -> Duration
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".