pub struct AppSettings {Show 18 fields
pub window_title: String,
pub application_id: Option<String>,
pub initial_width: u32,
pub initial_height: u32,
pub initial_size_explicit: bool,
pub web_fill_viewport: bool,
pub fonts: Option<&'static [&'static [u8]]>,
pub font_registry: SoftwareTextFontRegistry,
pub android_use_system_fonts: bool,
pub android_gpu_backend: AndroidGpuBackend,
pub log_tag: Option<String>,
pub android_overlay_window: Option<AndroidOverlayWindowOptions>,
pub headless: bool,
pub primary_window_visible: bool,
pub dev_options: DevOptions,
pub frame_pacing_mode: FramePacingMode,
pub frame_pacing_explicit: bool,
pub record_to: Option<PathBuf>,
}Expand description
Configuration for application settings.
Fields§
§window_title: StringWindow title (desktop) / app name (mobile)
application_id: Option<String>The id every framework-owned storage path is scoped by.
Android and iOS take it from what the platform packaged; a desktop or web build states it here. Left unset, the desktop backend derives one from the executable name, which is right for a development build and wrong for a shipped one.
initial_width: u32Initial window width in logical pixels.
initial_height: u32Initial window height in logical pixels.
initial_size_explicit: boolWhether the initial size was explicitly supplied by the app.
web_fill_viewport: boolWeb only: give the canvas the full browser viewport instead of the box the host page lays it out in.
The default leaves the canvas box to the page’s own stylesheet, so a canvas nested in a phone frame, a card or any clipping container keeps the size that container gives it. An app that owns the whole page opts in here and the canvas fills the dynamic viewport, tracking the browser window as it resizes; other platforms ignore this field.
fonts: Option<&'static [&'static [u8]]>Fonts loaded for text rendering (ordered: primary first, fallbacks last).
font_registry: SoftwareTextFontRegistryApp-supplied font families, already read and parsed.
This is where fonts that are not compiled into the binary live: files on
disk, platform system fonts, APK assets. Faces registered here carry the
FontFamily an app names them by, so a TextStyle asking for that
family resolves to them for both measurement and drawing.
android_use_system_fonts: boolWhether to load system fonts on Android (default: false)
android_gpu_backend: AndroidGpuBackendGraphics API selected for the Android WGPU renderer.
log_tag: Option<String>The tag this application’s log lines carry.
Android routes every log line through one tag, and adb logcat -s <tag> is how anyone reads them; an application that wants its own name
there had to initialise the platform logger itself, before the framework
did, and hope the ordering held. Naming it here removes both the
platform call and the race. Unset, lines carry Cranpose.
android_overlay_window: Option<AndroidOverlayWindowOptions>Optional Android overlay surface configuration.
headless: boolRun in headless mode (window hidden, for robot testing)
When enabled, the window is created but not shown. This allows robot tests to run in parallel without cluttering the screen and enables CI environments without a display server.
primary_window_visible: boolWhether the launcher-created primary desktop window should be visible.
Multi-window apps can hide this bootstrap surface and declare their
visible operating-system windows through run_windows.
dev_options: DevOptionsDevelopment options for debugging and performance monitoring
frame_pacing_mode: FramePacingModeInitial desktop frame pacing mode.
frame_pacing_explicit: boolWhether the app chose a frame pacing mode explicitly. Installing a robot test driver lifts the vsync cap only when this is false.
record_to: Option<PathBuf>Optional path to record input events to (for generating robot tests)
Implementations§
Source§impl AppSettings
impl AppSettings
Sourcepub fn resolve_font_set(&self) -> SoftwareTextFontSet
pub fn resolve_font_set(&self) -> SoftwareTextFontSet
The font set every platform entry point hands its renderer.
One definition so the platforms cannot drift, and so the measurer and
the rasterizer are built from the same faces: app-registered families
first, then the static with_fonts() slices as unnamed fallbacks, then
the embedded default face if nothing else loaded.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppSettings
impl !UnwindSafe for AppSettings
impl Freeze for AppSettings
impl Send for AppSettings
impl Sync for AppSettings
impl Unpin for AppSettings
impl UnsafeUnpin for AppSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.