Expand description
App process implementation.
§Widget Instantiation
See enable_widget_macros! if you want to instantiate widgets without depending on the zng crate.
§Crate
This crate is part of the zng project.
§Cargo Features
This crate provides 12 feature flags, 2 enabled by default.
§"debug_default"
Enable the "dyn_*" and "inspector" features in debug builds.
Enabled by default.
§"dyn_node"
Use dynamic dispatch at the node level by placing each property node in a BoxedUiNode and enabling UiNode::cfg_boxed.
This speeds-up compilation time at the cost of runtime.
§"inspector"
Instrument each widget instance to retain build information.
§"dyn_app_extension"
Use dynamic dispatch at the app-extension level.
This speeds-up compilation time at the cost of runtime.
§"dyn_closure"
Box closures at opportune places, such as Var::map, reducing the number of monomorphised types.
This speeds-up compilation time at the cost of runtime.
§"test_util"
Like cfg(test) but also visible in docs and integration tests.
§"multi_app"
Allows multiple app instances per-process.
This feature allows multiple apps, one app per thread at a time. The LocalContext tracks
what app is currently running in each thread and app_local! statics switch to the value of each app
depending on the current thread.
Not enabled by default, but enabled by feature="test_util".
§"trace_widget"
Instrument every widget outer-most node to trace UI methods.
§"trace_wgt_item"
Instrument every property and intrinsic node to trace UI methods.
Note that this can cause very large trace files and bad performance.
§"crash_handler"
Allow app-process crash handler.
Only enables in not(any(target_arch = "wasm32", target_os = "android")) builds.
§"ipc"
Enables IPC tasks and pre-build views and connecting to views running in another process.
Enabled by default.
§"deadlock_detection"
Spawns a thread on app creation that checks and prints parking_lot deadlocks.
Not enabled by default, but enabled by feature="test_util".
Modules§
- Accessibility/automation events.
- App-process crash handler.
- App event and commands API.
- Handler types and macros.
- Frame render and metadata API.
- Key combination types.
- Third party licenses service and types.
- App timers, deadlines and timeouts.
- App updates API.
- View process connection and other types.
- Widget, UI node API.
- Window context API.
Macros§
- Declare a mutable clone-move app event handler.
- Declare a clone-move app event handler that is only called once.
- Declare an async clone-move app event handler.
- Declare an async clone-move app event handler that is only called once.
- Declare an async clone-move event handler.
- Declare an async clone-move event handler that is only called once.
- Declares new
Commandstatic items. - Register a
FnOnce(&mut CrashConfig)closure to be called on process init to configure the crash handler. - Enable widget instantiation in crates that can’t depend on the
zngcrate. - Declares new
EventArgstypes. - Declares new
Event<A>static items. - Declare a mutable clone-move event handler.
- Declare a clone-move event handler that is only called once.
- New
Box<PropertyArgs>box from a property and value. - New
PropertyIdthat represents the type and name. - New
PropertyInfofrom property path. - Gets the strong input storage types from a property path.
- Creates a
Shortcut. - New
SourceLocationthat represents the location you call this macro. - Declares a static unique ID that is lazy inited.
- Creates an
UiVeccontaining the arguments. - Implement a property on the widget to strongly associate it with the widget.
- Sets properties and when condition on a widget builder.
- Gets the
WidgetTypeinfo of a widget.
Structs§
- Start and manage an app process.
- A sender that can awake apps and insert events into the main loop.
- Represents a channel receiver in an app extension.
- Represents a channel sender that causes an extensions update for each value transferred.
- Error when the app connected to a sender/receiver channel has disconnected.
- Application builder.
- Info about an app-extension.
- List of app-extensions that are part of an app.
- Arguments for
on_app_starthandlers. - Duration elapsed since an epoch.
- Represents a timeout instant.
- Cancellation message of an exit request.
- Arguments for
EXIT_REQUESTED_EVENT. - A headless app controller.
- Instant service.
Enums§
- Desired next step of app main loop.
- Defines how the
INSTANT.nowvalue updates in the app.
Statics§
- Represents the app process
exitrequest. - Cancellable event raised when app process exit is requested.
Traits§
- Observer for
HeadlessApp::update_observed. - An app extension.
Functions§
- Register a
handlerto run when anAPPstarts running in the process. - Enables
tracingevents printing if a subscriber is not already set. - Filter used by
print_tracing, removes some log noise from dependencies. - Modifies the
print_tracingsubscriber to panic for error logs in the current app.