logo
pub struct Settings<Flags> {
    pub id: Option<String>,
    pub window: Settings,
    pub flags: Flags,
    pub default_font: Option<&'static [u8]>,
    pub default_text_size: u16,
    pub text_multithreading: bool,
    pub antialiasing: bool,
    pub exit_on_close_request: bool,
    pub try_opengles_first: bool,
}
Expand description

The settings of an application.

Fields

id: Option<String>

The identifier of the application.

If provided, this identifier may be used to identify the application or communicate with it through the windowing system.

window: Settings

The window settings.

They will be ignored on the Web.

flags: Flags

The data needed to initialize the Application.

default_font: Option<&'static [u8]>

The bytes of the font that will be used by default.

If None is provided, a default system font will be chosen.

default_text_size: u16

The text size that will be used by default.

The default value is 20.

text_multithreading: bool

If enabled, spread text workload in multiple threads when multiple cores are available.

By default, it is disabled.

antialiasing: bool

If set to true, the renderer will try to perform antialiasing for some primitives.

Enabling it can produce a smoother result in some widgets, like the Canvas, at a performance cost.

By default, it is disabled.

exit_on_close_request: bool

Whether the Application should exit when the user requests the window to close (e.g. the user presses the close button).

By default, it is enabled.

try_opengles_first: bool

Whether the Application should try to build the context using OpenGL ES first then OpenGL.

By default, it is disabled. Note: Only works for the glow backend.

Implementations

Initialize Application settings using the given data.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.