Skip to main content

AppSettings

Struct AppSettings 

Source
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: String

Window 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: u32

Initial window width in logical pixels.

§initial_height: u32

Initial window height in logical pixels.

§initial_size_explicit: bool

Whether the initial size was explicitly supplied by the app.

§web_fill_viewport: bool

Web 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: SoftwareTextFontRegistry

App-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: bool

Whether to load system fonts on Android (default: false)

§android_gpu_backend: AndroidGpuBackend

Graphics 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: bool

Run 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: bool

Whether 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: DevOptions

Development options for debugging and performance monitoring

§frame_pacing_mode: FramePacingMode

Initial desktop frame pacing mode.

§frame_pacing_explicit: bool

Whether 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

Source

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§

Source§

impl Default for AppSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more