#[non_exhaustive]pub struct WindowOptions {
pub title: String,
pub size: Size,
pub theme: Theme,
pub instances: usize,
pub backend: Backend,
}Expand description
The window run opens.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: StringThe window’s title.
size: SizeThe window’s inner size, in logical pixels.
theme: ThemeColors and sizes of the widgets.
instances: usizeRectangles and glyphs a frame can hold; more are dropped (and counted).
backend: BackendThe graphics API that draws the window.
Implementations§
Source§impl WindowOptions
impl WindowOptions
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
A 1280x800 window titled title, with the default theme.
Sourcepub fn with_size(self, width: f32, height: f32) -> Self
pub fn with_size(self, width: f32, height: f32) -> Self
The options with an inner size in logical pixels.
Sourcepub fn with_theme(self, theme: Theme) -> Self
pub fn with_theme(self, theme: Theme) -> Self
The options with theme.
Sourcepub fn with_backend(self, backend: Backend) -> Self
pub fn with_backend(self, backend: Backend) -> Self
The options drawing with backend; see Backend.
Sourcepub fn with_instances(self, instances: usize) -> Self
pub fn with_instances(self, instances: usize) -> Self
The options holding up to instances rectangles and glyphs a frame.
Trait Implementations§
Source§impl Clone for WindowOptions
impl Clone for WindowOptions
Auto Trait Implementations§
impl Freeze for WindowOptions
impl RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin for WindowOptions
impl UnwindSafe for WindowOptions
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
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)
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.