Struct zng_app::AppExtended
source · pub struct AppExtended<E: AppExtension> { /* private fields */ }Expand description
Application builder.
You can use APP to start building the app.
Implementations§
source§impl AppExtended<Vec<Box<dyn AppExtensionBoxed>>>
impl AppExtended<Vec<Box<dyn AppExtensionBoxed>>>
sourcepub fn extend<F: AppExtension>(
self,
extension: F
) -> AppExtended<Vec<Box<dyn AppExtensionBoxed>>>
pub fn extend<F: AppExtension>( self, extension: F ) -> AppExtended<Vec<Box<dyn AppExtensionBoxed>>>
Includes an application extension.
sourcepub fn enable_device_events(
self
) -> AppExtended<Vec<Box<dyn AppExtensionBoxed>>>
pub fn enable_device_events( self ) -> AppExtended<Vec<Box<dyn AppExtensionBoxed>>>
If the application should notify raw device events.
Device events are raw events not targeting any window, like a mouse move on any part of the screen.
They tend to be high-volume events so there is a performance cost to activating this. Note that if
this is false you still get the mouse move over windows of the app.
source§impl<E: AppExtension> AppExtended<E>
impl<E: AppExtension> AppExtended<E>
sourcepub fn view_process_exe(self, view_process_exe: impl Into<PathBuf>) -> Self
pub fn view_process_exe(self, view_process_exe: impl Into<PathBuf>) -> Self
Set the path to the executable for the View Process.
By the default the current executable is started again as a View Process, you can use two executables instead, by setting this value.
Note that the view_process_exe must start a view server and both
executables must be build using the same exact VERSION.
sourcepub fn run(self, start: impl Future<Output = ()> + Send + 'static)
pub fn run(self, start: impl Future<Output = ()> + Send + 'static)
Starts the app, then starts polling start to run.
This method only returns when the app has exited.
The start task runs in a UiTask in the app context, note that it only needs to start the app, usually
by opening a window, the app will keep running after start is finished.
sourcepub fn run_headless(self, with_renderer: bool) -> HeadlessApp
pub fn run_headless(self, with_renderer: bool) -> HeadlessApp
Initializes extensions in headless mode and returns an HeadlessApp.
If with_renderer is true spawns a renderer process for headless rendering. See HeadlessApp::renderer_enabled
for more details.