pub struct Options<T> {
pub caption: String,
pub canvas_id: String,
pub modules: Option<Vec<Module<T>>>,
pub default_module: Option<TypeId>,
pub native_options: NativeOptions,
}Expand description
Configuration for launching an application, covering the window caption, web canvas target, available modules and platform-specific eframe options.
Fields§
§caption: StringWindow title (native) caption for the application.
canvas_id: StringDOM id of the HTML canvas to mount the application into (web).
modules: Option<Vec<Module<T>>>Optional set of application modules to register.
default_module: Option<TypeId>Identifier of the module to activate on startup, if any.
native_options: NativeOptionseframe native window options (native targets only).
Implementations§
Source§impl<T> Options<T>where
T: App,
impl<T> Options<T>where
T: App,
Sourcepub fn new(caption: String, canvas_id: String) -> Self
pub fn new(caption: String, canvas_id: String) -> Self
Create options with the given window caption and web canvas id, leaving modules and platform options at their defaults.
Sourcepub fn with_native_options(self, native_options: NativeOptions) -> Self
pub fn with_native_options(self, native_options: NativeOptions) -> Self
Override the eframe native window options (native targets only).
Sourcepub fn with_modules(
self,
default_module: TypeId,
modules: Vec<Module<T>>,
) -> Self
pub fn with_modules( self, default_module: TypeId, modules: Vec<Module<T>>, ) -> Self
Register the application’s modules and select the one identified by
default_module as the initially active module.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Options<T>
impl<T> !Send for Options<T>
impl<T> !Sync for Options<T>
impl<T> !UnwindSafe for Options<T>
impl<T> Freeze for Options<T>
impl<T> Unpin for Options<T>
impl<T> UnsafeUnpin for Options<T>
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> 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.