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
sourceimpl<Flags> Settings<Flags>
impl<Flags> Settings<Flags>
sourcepub fn with_flags(flags: Flags) -> Self
pub fn with_flags(flags: Flags) -> Self
Initialize Application
settings using the given data.
Trait Implementations
Auto Trait Implementations
impl<Flags> RefUnwindSafe for Settings<Flags> where
Flags: RefUnwindSafe,
impl<Flags> Send for Settings<Flags> where
Flags: Send,
impl<Flags> Sync for Settings<Flags> where
Flags: Sync,
impl<Flags> Unpin for Settings<Flags> where
Flags: Unpin,
impl<Flags> UnwindSafe for Settings<Flags> where
Flags: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more